summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/modules/alsa/alsa-sink.c2
-rw-r--r--src/modules/alsa/alsa-source.c2
-rw-r--r--src/pulsecore/sink.c6
-rw-r--r--src/pulsecore/source.c6
4 files changed, 12 insertions, 4 deletions
diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index 98ebac3f..59a5ca75 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -1199,7 +1199,7 @@ fail:
static void sink_get_mute_cb(pa_sink *s) {
struct userdata *u = s->userdata;
- int err, sw;
+ int err, sw = 0;
pa_assert(u);
pa_assert(u->mixer_elem);
diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c
index 277b1103..c176309e 100644
--- a/src/modules/alsa/alsa-source.c
+++ b/src/modules/alsa/alsa-source.c
@@ -1158,7 +1158,7 @@ fail:
static void source_get_mute_cb(pa_source *s) {
struct userdata *u = s->userdata;
- int err, sw;
+ int err, sw = 0;
pa_assert(u);
pa_assert(u->mixer_elem);
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index db9b4f3a..5d54d839 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -1365,8 +1365,12 @@ pa_bool_t pa_sink_get_mute(pa_sink *s, pa_bool_t force_refresh) {
pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SINK_MESSAGE_GET_MUTE, NULL, 0, NULL) == 0);
- if (old_muted != s->muted)
+ if (old_muted != s->muted) {
pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SINK|PA_SUBSCRIPTION_EVENT_CHANGE, s->index);
+
+ /* Make sure the soft mute status stays in sync */
+ pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SINK_MESSAGE_SET_MUTE, NULL, 0, NULL) == 0);
+ }
}
return s->muted;
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index abb5f4d1..53697c57 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -768,8 +768,12 @@ pa_bool_t pa_source_get_mute(pa_source *s, pa_bool_t force_refresh) {
pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SOURCE_MESSAGE_GET_MUTE, NULL, 0, NULL) == 0);
- if (old_muted != s->muted)
+ if (old_muted != s->muted) {
pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SOURCE|PA_SUBSCRIPTION_EVENT_CHANGE, s->index);
+
+ /* Make sure the soft mute status stays in sync */
+ pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SOURCE_MESSAGE_SET_MUTE, NULL, 0, NULL) == 0);
+ }
}
return s->muted;