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/pstream.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/pstream.c')
-rw-r--r-- | src/polypcore/pstream.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/polypcore/pstream.c b/src/polypcore/pstream.c index b93dca08..09bd1e27 100644 --- a/src/polypcore/pstream.c +++ b/src/polypcore/pstream.c @@ -37,6 +37,7 @@ #include <polypcore/queue.h> #include <polypcore/xmalloc.h> #include <polypcore/log.h> +#include <polypcore/core-scache.h> #include "pstream.h" @@ -52,7 +53,7 @@ enum { typedef uint32_t pa_pstream_descriptor[PA_PSTREAM_DESCRIPTOR_MAX]; #define PA_PSTREAM_DESCRIPTOR_SIZE (PA_PSTREAM_DESCRIPTOR_MAX*sizeof(uint32_t)) -#define FRAME_SIZE_MAX (1024*500) /* half a megabyte */ +#define FRAME_SIZE_MAX PA_SCACHE_ENTRY_SIZE_MAX /* allow uploading a single sample in one frame at max */ struct item_info { enum { PA_PSTREAM_ITEM_PACKET, PA_PSTREAM_ITEM_MEMBLOCK } type; @@ -419,7 +420,7 @@ static int do_read(pa_pstream *p) { /* Frame size too large */ if (ntohl(p->read.descriptor[PA_PSTREAM_DESCRIPTOR_LENGTH]) > FRAME_SIZE_MAX) { - pa_log_warn(__FILE__": Frame size too large"); + pa_log_warn(__FILE__": Frame size too large: %lu > %lu", (unsigned long) ntohl(p->read.descriptor[PA_PSTREAM_DESCRIPTOR_LENGTH]), (unsigned long) FRAME_SIZE_MAX); return -1; } |