summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTanu Kaskinen <tanu.kaskinen@linux.intel.com>2014-04-15 13:56:06 +0300
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>2014-05-02 15:50:15 +0300
commit080bdf1b6b1be0df0a77f77838594345481db072 (patch)
treec5b30fcd88bb32cb03ef8b51e63117b9c2a577a7
parent70441d40fb07b13cca85d08fe09c9ddb81eadaf0 (diff)
sink-input, source-output: Add logging to set_mute()
-rw-r--r--src/pulsecore/sink-input.c8
-rw-r--r--src/pulsecore/source-output.c8
2 files changed, 14 insertions, 2 deletions
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index 451ca634f..e41afc9ba 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -1399,16 +1399,22 @@ pa_cvolume *pa_sink_input_get_volume(pa_sink_input *i, pa_cvolume *volume, bool
/* Called from main context */
void pa_sink_input_set_mute(pa_sink_input *i, bool mute, bool save) {
+ bool old_mute;
+
pa_sink_input_assert_ref(i);
pa_assert_ctl_context();
pa_assert(PA_SINK_INPUT_IS_LINKED(i->state));
- if (mute == i->muted) {
+ old_mute = i->muted;
+
+ if (mute == old_mute) {
i->save_muted |= save;
return;
}
i->muted = mute;
+ pa_log_debug("The mute of sink input %u changed from %s to %s.", i->index, pa_yes_no(old_mute), pa_yes_no(mute));
+
i->save_muted = save;
pa_assert_se(pa_asyncmsgq_send(i->sink->asyncmsgq, PA_MSGOBJECT(i), PA_SINK_INPUT_MESSAGE_SET_SOFT_MUTE, NULL, 0, NULL) == 0);
diff --git a/src/pulsecore/source-output.c b/src/pulsecore/source-output.c
index 9709d77e6..bb893847d 100644
--- a/src/pulsecore/source-output.c
+++ b/src/pulsecore/source-output.c
@@ -1057,16 +1057,22 @@ pa_cvolume *pa_source_output_get_volume(pa_source_output *o, pa_cvolume *volume,
/* Called from main context */
void pa_source_output_set_mute(pa_source_output *o, bool mute, bool save) {
+ bool old_mute;
+
pa_source_output_assert_ref(o);
pa_assert_ctl_context();
pa_assert(PA_SOURCE_OUTPUT_IS_LINKED(o->state));
- if (mute == o->muted) {
+ old_mute = o->muted;
+
+ if (mute == old_mute) {
o->save_muted |= save;
return;
}
o->muted = mute;
+ pa_log_debug("The mute of source output %u changed from %s to %s.", o->index, pa_yes_no(old_mute), pa_yes_no(mute));
+
o->save_muted = save;
pa_assert_se(pa_asyncmsgq_send(o->source->asyncmsgq, PA_MSGOBJECT(o), PA_SOURCE_OUTPUT_MESSAGE_SET_SOFT_MUTE, NULL, 0, NULL) == 0);