mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-08 13:29:59 -05:00
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
This commit is contained in:
parent
de02c74916
commit
67766785a5
1 changed files with 4 additions and 0 deletions
|
|
@ -46,6 +46,7 @@
|
||||||
#include "sink.h"
|
#include "sink.h"
|
||||||
|
|
||||||
#define MAX_MIX_CHANNELS 32
|
#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);
|
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 (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_get_length(s->silence) < length) {
|
||||||
if (s->silence)
|
if (s->silence)
|
||||||
pa_memblock_unref(s->silence);
|
pa_memblock_unref(s->silence);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue