summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Chini <georg@chini.tk>2015-03-26 21:54:19 +0100
committerTanu Kaskinen <tanuk@iki.fi>2016-03-12 16:55:59 +0200
commit7f5f25bb1a8586f326e6bad3742422e9c5991a06 (patch)
treee493f7b09f671a4ab3d8d51a6424104955a48811
parent075796d7675173f520070ff47171c54c46d52034 (diff)
downloadpulseaudio-7f5f25bb1a8586f326e6bad3742422e9c5991a06.tar.gz
role-cork: allow cork of all non-trigger streams using cork_roles=any_role
There might be situations where you want to cork all streams that are not trigger streams. Use cork_roles=any_role to implement this.
-rw-r--r--src/modules/module-role-cork.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/modules/module-role-cork.c b/src/modules/module-role-cork.c
index e513de34d..b4cb6ceab 100644
--- a/src/modules/module-role-cork.c
+++ b/src/modules/module-role-cork.c
@@ -124,6 +124,8 @@ static inline void apply_cork_to_sink(struct userdata *u, pa_sink *s, pa_sink_in
PA_IDXSET_FOREACH(cork_role, u->cork_roles, role_idx) {
if ((trigger = pa_streq(role, cork_role)))
break;
+ if ((trigger = (pa_streq(cork_role, "any_role") && !is_trigger_stream(u, j))))
+ break;
}
if (!trigger)
continue;
@@ -132,7 +134,7 @@ static inline void apply_cork_to_sink(struct userdata *u, pa_sink *s, pa_sink_in
corked_here = !!pa_hashmap_get(u->cork_state, j);
if (cork && !corked && !j->muted) {
- pa_log_debug("Found a '%s' stream that should be corked/muted.", cork_role);
+ pa_log_debug("Found a '%s' stream that should be corked/muted.", role);
if (!corked_here)
pa_hashmap_put(u->cork_state, j, PA_INT_TO_PTR(1));
pa_sink_input_set_mute(j, true, false);
@@ -141,7 +143,7 @@ static inline void apply_cork_to_sink(struct userdata *u, pa_sink *s, pa_sink_in
pa_hashmap_remove(u->cork_state, j);
if (corked_here && (corked || j->muted)) {
- pa_log_debug("Found a '%s' stream that should be uncorked/unmuted.", cork_role);
+ pa_log_debug("Found a '%s' stream that should be uncorked/unmuted.", role);
if (j->muted)
pa_sink_input_set_mute(j, false, false);
if (corked)