sink, source: Call set_mute() from mute_changed() 56/21956/1
authorTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Tue, 15 Apr 2014 06:39:49 +0000 (09:39 +0300)
committerIsmo Puustinen <ismo.puustinen@intel.com>
Wed, 28 May 2014 09:40:04 +0000 (12:40 +0300)
commit72f2a63fa7a1ddde55dfade5e749ea950754670a
tree31604da559b5a8253a4cd364728f1cb2154830b5
parent199be180f17af0ee743fe0779beb5df668f55307
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.

Change-Id: I33c81f4034001f777c4533c2c63eada67548c683
Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
src/pulsecore/sink.c
src/pulsecore/sink.h
src/pulsecore/source.c
src/pulsecore/source.h