sink, source: don't try to update volumes of not-yet-linked devices
authorTanu Kaskinen <tanuk@iki.fi>
Sun, 10 Sep 2017 19:32:56 +0000 (22:32 +0300)
committerTanu Kaskinen <tanuk@iki.fi>
Mon, 18 Sep 2017 15:49:34 +0000 (18:49 +0300)
commit95d618751c0a7cb4d739d339d97499d0c98fb955
tree4e61ea3ae6c36ef19e7282f2ad4d911d40c6c005
parent24928d6b6fa1cde3312bcf63e4e14d7003aadc69
sink, source: don't try to update volumes of not-yet-linked devices

The order of the pa_sink_input_put() and pa_sink_put() calls in filter
modules was swapped in commit edc465da77 ("virtual sources and sinks:
Don't double attach a sink input or source output on filter load").
If flat volumes and volume sharing is enabled, the pa_sink_input_put()
call will update volumes of the whole tree of virtual sinks that are
connected to the root sink. The recursive updating procedure tried to
also update the volume of the new sink for which pa_sink_put() had not
yet been called, causing an assertion failure.

This patch tries to make sure that the volume of not-yet-linked sinks
is never changed. pa_sink_put() will set the sink volume correctly, so
it's fine to skip the not-yet-linked sinks during pa_sink_input_put().

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=102549
src/pulsecore/sink.c
src/pulsecore/source.c