]> code.delx.au - pulseaudio/commit
sink, source: Call set_mute() from mute_changed()
authorTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Tue, 15 Apr 2014 10:56:09 +0000 (13:56 +0300)
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Fri, 2 May 2014 12:50:15 +0000 (15:50 +0300)
commitdbd2a8f851437a79f62e992a52476056588c9780
tree26ed35f9cb6b3dc4a8f59c0f8e9a14ef785857ae
parentc93cfc1ca64a3d7e37a3ca63f42abb73ce72bfb6
sink, source: Call set_mute() from mute_changed()

This refactoring reduces duplication, as mute_changed() used to do the
same things as set_mute(). Other benefits are improved logging
(set_mute() logs the mute change, mute_changed() used to not do that)
and the soft mute state is kept up to date, because set_mute() sends
the SET_MUTE message to the IO thread.

The set_mute_in_progress flag is an extra precaution for preventing
recursion in case a sink/source implementation's set_mute() callback
causes mute_changed() to be called. Currently there are no such
implementations, but I think that would be a valid thing to do, so
some day there might be such implementation.
src/pulsecore/sink.c
src/pulsecore/sink.h
src/pulsecore/source.c
src/pulsecore/source.h