sink-input, source-output: Remove redundant get_mute() functions

The functions just return the muted value. Callers can as well read
the struct field directly, it's simpler that way.
This commit is contained in:
Tanu Kaskinen 2014-04-15 13:56:11 +03:00
parent e4a7625ba8
commit ef4ae785aa
9 changed files with 12 additions and 33 deletions

View file

@ -765,7 +765,7 @@ static void subscription_cb(pa_core *c, pa_subscription_event_type_t t, uint32_t
}
}
new_mute = pa_sink_input_get_mute(s->sink_input);
new_mute = s->sink_input->muted;
if (s->mute != new_mute) {
s->mute = new_mute;
@ -861,7 +861,7 @@ pa_dbusiface_stream *pa_dbusiface_stream_new_playback(pa_dbusiface_core *core, p
else
pa_cvolume_init(&s->volume);
s->mute = pa_sink_input_get_mute(sink_input);
s->mute = sink_input->muted;
s->proplist = pa_proplist_copy(sink_input->proplist);
s->dbus_protocol = pa_dbus_protocol_get(sink_input->core);
s->subscription = pa_subscription_new(sink_input->core, PA_SUBSCRIPTION_MASK_SINK_INPUT, subscription_cb, s);

View file

@ -102,7 +102,7 @@ static inline void apply_cork_to_sink(struct userdata *u, pa_sink *s, pa_sink_in
pa_sink_assert_ref(s);
for (j = PA_SINK_INPUT(pa_idxset_first(s->inputs, &idx)); j; j = PA_SINK_INPUT(pa_idxset_next(s->inputs, &idx))) {
bool corked, muted, corked_here;
bool corked, corked_here;
const char *role;
if (j == ignore)
@ -119,10 +119,9 @@ static inline void apply_cork_to_sink(struct userdata *u, pa_sink *s, pa_sink_in
continue;
corked = (pa_sink_input_get_state(j) == PA_SINK_INPUT_CORKED);
muted = pa_sink_input_get_mute(j);
corked_here = !!pa_hashmap_get(u->cork_state, j);
if (cork && !corked && !muted) {
if (cork && !corked && !j->muted) {
pa_log_debug("Found a '%s' stream that should be corked/muted.", cork_role);
if (!corked_here)
pa_hashmap_put(u->cork_state, j, PA_INT_TO_PTR(1));
@ -131,9 +130,9 @@ static inline void apply_cork_to_sink(struct userdata *u, pa_sink *s, pa_sink_in
} else if (!cork) {
pa_hashmap_remove(u->cork_state, j);
if (corked_here && (corked || muted)) {
if (corked_here && (corked || j->muted)) {
pa_log_debug("Found a '%s' stream that should be uncorked/unmuted.", cork_role);
if (muted)
if (j->muted)
pa_sink_input_set_mute(j, false, false);
if (corked)
pa_sink_input_send_event(j, PA_STREAM_EVENT_REQUEST_UNCORK, NULL);

View file

@ -1299,7 +1299,7 @@ static void subscribe_callback(pa_core *c, pa_subscription_event_type_t t, uint3
}
if (sink_input->save_muted) {
entry->muted = pa_sink_input_get_mute(sink_input);
entry->muted = sink_input->muted;
entry->muted_valid = true;
mute_updated = !created_new_entry && (!old->muted_valid || entry->muted != old->muted);
@ -1349,7 +1349,7 @@ static void subscribe_callback(pa_core *c, pa_subscription_event_type_t t, uint3
}
if (source_output->save_muted) {
entry->muted = pa_source_output_get_mute(source_output);
entry->muted = source_output->muted;
entry->muted_valid = true;
mute_updated = !created_new_entry && (!old->muted_valid || entry->muted != old->muted);