mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
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.
This commit is contained in:
parent
ab5adce7a0
commit
587fc2ab1c
4 changed files with 12 additions and 4 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue