core: make sure we always return a valid memblock in sink_input_pop() callbacks

https://bugzilla.redhat.com/show_bug.cgi?id=553607
This commit is contained in:
Lennart Poettering 2010-01-08 21:51:30 +01:00 committed by Colin Guthrie
parent 699233fb47
commit 345547853b
6 changed files with 24 additions and 6 deletions

View file

@ -47,12 +47,16 @@ int pa_play_memchunk(
pa_memblockq *q;
int r;
pa_memchunk silence;
pa_assert(sink);
pa_assert(ss);
pa_assert(chunk);
q = pa_memblockq_new(0, chunk->length, 0, pa_frame_size(ss), 1, 1, 0, NULL);
pa_silence_memchunk_get(&sink->core->silence_cache, sink->core->mempool, &silence, ss, 0);
q = pa_memblockq_new(0, chunk->length, 0, pa_frame_size(ss), 1, 1, 0, &silence);
pa_memblock_unref(silence.memblock);
pa_assert_se(pa_memblockq_push(q, chunk) >= 0);
if ((r = pa_play_memblockq(sink, ss, map, q, volume, p, sink_input_index)) < 0) {