diff options
Diffstat (limited to 'src/pulsecore/sound-file.c')
| -rw-r--r-- | src/pulsecore/sound-file.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/pulsecore/sound-file.c b/src/pulsecore/sound-file.c index 50352930..3183ede6 100644 --- a/src/pulsecore/sound-file.c +++ b/src/pulsecore/sound-file.c @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of PulseAudio. @@ -47,7 +45,7 @@ int pa_sound_file_load( pa_sample_spec *ss, pa_channel_map *map, pa_memchunk *chunk) { - + SNDFILE *sf = NULL; SF_INFO sfinfo; int ret = -1; @@ -79,7 +77,7 @@ int pa_sound_file_load( } else pa_log_debug("POSIX_FADV_SEQUENTIAL succeeded."); #endif - + if (!(sf = sf_open_fd(fd, SFM_READ, &sfinfo, 1))) { pa_log("Failed to open file %s", fname); pa_close(fd); @@ -119,7 +117,7 @@ int pa_sound_file_load( } if (map) - pa_channel_map_init_auto(map, ss->channels, PA_CHANNEL_MAP_DEFAULT); + pa_channel_map_init_extend(map, ss->channels, PA_CHANNEL_MAP_DEFAULT); if ((l = pa_frame_size(ss) * sfinfo.frames) > PA_SCACHE_ENTRY_SIZE_MAX) { pa_log("File too large"); @@ -155,13 +153,13 @@ finish: } int pa_sound_file_too_big_to_cache(const char *fname) { - + SNDFILE*sf = NULL; SF_INFO sfinfo; pa_sample_spec ss; pa_assert(fname); - + if (!(sf = sf_open(fname, SFM_READ, &sfinfo))) { pa_log("Failed to open file %s", fname); return -1; @@ -198,7 +196,7 @@ int pa_sound_file_too_big_to_cache(const char *fname) { pa_log("Unsupported sample format in file %s", fname); return -1; } - + if ((pa_frame_size(&ss) * sfinfo.frames) > PA_SCACHE_ENTRY_SIZE_MAX) { pa_log("File too large: %s", fname); return 1; |
