summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/pulsecore/sink.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index 11effe2f..d5ca061f 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -46,6 +46,7 @@
#include "sink.h"
#define MAX_MIX_CHANNELS 32
+#define SILENCE_BUFFER_LENGTH (64*1024)
static PA_DEFINE_CHECK_TYPE(pa_sink, sink_check_type, pa_msgobject_check_type);
@@ -364,6 +365,9 @@ void pa_sink_render(pa_sink*s, size_t length, pa_memchunk *result) {
if (n == 0) {
+ if (length > SILENCE_BUFFER_LENGTH)
+ length = SILENCE_BUFFER_LENGTH;
+
if (!s->silence || pa_memblock_get_length(s->silence) < length) {
if (s->silence)
pa_memblock_unref(s->silence);