[pulseaudio-discuss] [PATCH] combine-sink: Fix unsafe message handling

Tanu Kaskinen tanuk at iki.fi
Tue Jul 21 10:09:27 PDT 2015

On Sat, 2015-06-27 at 18:36 +0300, Tanu Kaskinen wrote:
> This fixes a crash. sink_input_pop_cb() drains the message queue that receives
> memchunks from the combine sink thread to avoid requesting more audio too soon.
> The same message queue received also SET_REQUESTED_LATENCY messages, which
> generate rewind requests. Rewind requests shouldn't be issued in the pop()
> callback, doing so results in an assertion error. Therefore, it was not safe to
> drain the message queue in the pop() callback, but usually the queue is empty,
> so this bug was not immediately detected.
> This patch splits the message queue into two queues: audio_inq and control_inq.
> audio_inq receives only messages containing memchunks, and control_inq receives
> only the SET_REQUESTED_LATENCY messages. The pop() callback only drains the
> audio queue, which avoids the rewind requests in the pop() callback.
> BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=90489
> ---
>  src/modules/module-combine-sink.c | 108 ++++++++++++++++++++++++++++
> ----------
>  1 file changed, 80 insertions(+), 28 deletions(-)

I applied this now.


More information about the pulseaudio-discuss mailing list