diff options
author | Lennart Poettering <lennart@poettering.net> | 2006-04-23 20:59:09 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2006-04-23 20:59:09 +0000 |
commit | e1ac42dd10e3085cdcc9ed9f0de60c8457c77701 (patch) | |
tree | 9cef1022f0f070823343f2da26d815e588b8ad7e /src/polypcore/sound-file.c | |
parent | cdba0527a8b33874816da339d06133ec7bc85918 (diff) |
enforce maximum sample size in sample cache
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@787 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/polypcore/sound-file.c')
-rw-r--r-- | src/polypcore/sound-file.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/polypcore/sound-file.c b/src/polypcore/sound-file.c index 7a4ef075..a6ccb064 100644 --- a/src/polypcore/sound-file.c +++ b/src/polypcore/sound-file.c @@ -32,8 +32,7 @@ #include <polypcore/log.h> #include "sound-file.h" - -#define MAX_FILE_SIZE (1024*1024) +#include "core-scache.h" int pa_sound_file_load(const char *fname, pa_sample_spec *ss, pa_channel_map *map, pa_memchunk *chunk, pa_memblock_stat *s) { SNDFILE*sf = NULL; @@ -78,7 +77,7 @@ int pa_sound_file_load(const char *fname, pa_sample_spec *ss, pa_channel_map *ma if (map) pa_channel_map_init_auto(map, ss->channels); - if ((l = pa_frame_size(ss)*sfinfo.frames) > MAX_FILE_SIZE) { + if ((l = pa_frame_size(ss)*sfinfo.frames) > PA_SCACHE_ENTRY_SIZE_MAX) { pa_log(__FILE__": File too large"); goto finish; } @@ -134,7 +133,7 @@ int pa_sound_file_too_big_to_cache(const char *fname) { ss.rate = sfinfo.samplerate; ss.channels = sfinfo.channels; - if ((pa_frame_size(&ss) * sfinfo.frames) > MAX_FILE_SIZE) { + if ((pa_frame_size(&ss) * sfinfo.frames) > PA_SCACHE_ENTRY_SIZE_MAX) { pa_log(__FILE__": File too large %s", fname); return 1; } |