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)
committerArun Raghavan <arun@arunraghavan.net>
Wed, 13 Sep 2017 02:37:14 +0000 (08:07 +0530)
commit759705bc4f1bc819dbfbc1f68c1b0b4bd3a18734
treed24139a6c14cf7077b616fe54a52cbc009e554c3
parent8db681606cd8cbb8cee67529937deaa9e4558db9
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