diff options
author | Tanu Kaskinen <tanu.kaskinen@linux.intel.com> | 2014-04-15 13:56:10 +0300 |
---|---|---|
committer | Tanu Kaskinen <tanu.kaskinen@linux.intel.com> | 2014-05-02 16:00:49 +0300 |
commit | e4a7625ba884c5cce20468d75937857343751c35 (patch) | |
tree | fc1e3006882799306890952df38785a815f85eb7 /src/modules/module-solaris.c | |
parent | dbd2a8f851437a79f62e992a52476056588c9780 (diff) | |
download | pulseaudio-e4a7625ba884c5cce20468d75937857343751c35.tar.gz |
sink, source: Assign to s->muted from only one place
Forcing all mute changes to go through set_mute() makes it easier to
check where the muted field is changed, and it also allows us to have
only one place where notifications for changed mute are sent.
Diffstat (limited to 'src/modules/module-solaris.c')
-rw-r--r-- | src/modules/module-solaris.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/modules/module-solaris.c b/src/modules/module-solaris.c index b4fa73489..71a98e984 100644 --- a/src/modules/module-solaris.c +++ b/src/modules/module-solaris.c @@ -571,18 +571,23 @@ static void sink_set_mute(pa_sink *s) { } } -static void sink_get_mute(pa_sink *s) { +static int sink_get_mute(pa_sink *s, bool *mute) { struct userdata *u = s->userdata; audio_info_t info; pa_assert(u); - if (u->fd >= 0) { - if (ioctl(u->fd, AUDIO_GETINFO, &info) < 0) - pa_log("AUDIO_SETINFO: %s", pa_cstrerror(errno)); - else - s->muted = !!info.output_muted; + if (u->fd < 0) + return -1; + + if (ioctl(u->fd, AUDIO_GETINFO, &info) < 0) { + pa_log("AUDIO_GETINFO: %s", pa_cstrerror(errno)); + return -1; } + + *mute = info.output_muted; + + return 0; } static void process_rewind(struct userdata *u) { |