summaryrefslogtreecommitdiff
path: root/src/pulsecore
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-06-08 00:02:15 +0200
committerLennart Poettering <lennart@poettering.net>2009-06-08 00:02:15 +0200
commit587fc2ab1c7b53ddd28f35e19aad55caa804de1f (patch)
tree337f9508fa74319423786d6d81b6bc0f1f23035a /src/pulsecore
parentab5adce7a014f57df829491d06acafbfec3afb5d (diff)
core: make sure soft mute status stays in sync with hw mute status
This should close rhbz #494851, mandriva bz #51234. Probably the same as our own #572, launchpad #352732.
Diffstat (limited to 'src/pulsecore')
-rw-r--r--src/pulsecore/sink.c6
-rw-r--r--src/pulsecore/source.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index db9b4f3ad..5d54d8399 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 abb5f4d1b..53697c57d 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;