diff options
| author | Lennart Poettering <lennart@poettering.net> | 2007-06-24 16:17:30 +0000 | 
|---|---|---|
| committer | Lennart Poettering <lennart@poettering.net> | 2007-06-24 16:17:30 +0000 | 
| commit | 67766785a587ead4bf604ae789bc1112783ad97c (patch) | |
| tree | 9477fd8a0ffd09f4826e41e33de4a101f0d31a8b /src | |
| parent | de02c74916d60db6454a6691aca0b8401b9c88fd (diff) | |
Limit silence buffer size for pa_sink_render()
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1498 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src')
| -rw-r--r-- | src/pulsecore/sink.c | 4 | 
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); | 
