From: Lennart Poettering Date: Tue, 27 May 2008 22:05:31 +0000 (+0000) Subject: fix esound proto to not crash X-Git-Tag: 1.0_branch~2841 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=307645e6210a16ab1430972e260b8518f38474ad;p=profile%2Fivi%2Fpulseaudio.git fix esound proto to not crash git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@2488 fefdeb5f-60dc-0310-8127-8f9354f1896f --- diff --git a/src/pulsecore/protocol-esound.c b/src/pulsecore/protocol-esound.c index 492dc9f..22b49b5 100644 --- a/src/pulsecore/protocol-esound.c +++ b/src/pulsecore/protocol-esound.c @@ -1042,7 +1042,7 @@ static int do_read(connection *c) { } if (!c->playback.current_memblock) { - pa_assert_se(c->playback.current_memblock = pa_memblock_new(c->protocol->core->mempool, 0)); + pa_assert_se(c->playback.current_memblock = pa_memblock_new(c->protocol->core->mempool, (size_t) -1)); c->playback.memblock_index = 0; space = pa_memblock_get_length(c->playback.current_memblock); @@ -1275,6 +1275,8 @@ static int sink_input_pop_cb(pa_sink_input *i, size_t length, pa_memchunk *chunk } else { size_t m; + chunk->length = PA_MIN(length, chunk->length); + c->playback.underrun = FALSE; pa_memblockq_drop(c->input_memblockq, chunk->length);