summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorGeorg Chini <georg@chini.tk>2015-03-26 21:54:17 +0100
committerTanu Kaskinen <tanuk@iki.fi>2016-03-10 18:12:41 +0200
commit61164d3b5127fe93050f1a66e3d5b67b911560f0 (patch)
treeadbf58f4382dc3ec698e0dc5c8265e923eb41398 /src/modules
parent092eb57974eca4e2f824934718256c394ef921ab (diff)
role-cork: Don't ignore streams without media.role
When corking do not ignore streams without media.role. Instead treat them as if media.role="no_role", so that you can specify "no_role" as trigger or cork role.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/module-role-cork.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/modules/module-role-cork.c b/src/modules/module-role-cork.c
index 7c0f59fc2..835ce6564 100644
--- a/src/modules/module-role-cork.c
+++ b/src/modules/module-role-cork.c
@@ -77,7 +77,7 @@ static bool shall_cork(struct userdata *u, pa_sink *s, pa_sink_input *ignore) {
continue;
if (!(role = pa_proplist_gets(j->proplist, PA_PROP_MEDIA_ROLE)))
- continue;
+ role = "no_role";
PA_IDXSET_FOREACH(trigger_role, u->trigger_roles, role_idx) {
if (pa_streq(role, trigger_role)) {
@@ -107,7 +107,7 @@ static inline void apply_cork_to_sink(struct userdata *u, pa_sink *s, pa_sink_in
continue;
if (!(role = pa_proplist_gets(j->proplist, PA_PROP_MEDIA_ROLE)))
- continue;
+ role = "no_role";
PA_IDXSET_FOREACH(cork_role, u->cork_roles, role_idx) {
if ((trigger = pa_streq(role, cork_role)))
@@ -152,7 +152,6 @@ static void apply_cork(struct userdata *u, pa_sink *s, pa_sink_input *ignore, bo
static pa_hook_result_t process(struct userdata *u, pa_sink_input *i, bool create) {
bool cork = false;
- const char *role;
pa_assert(u);
pa_sink_input_assert_ref(i);
@@ -160,9 +159,6 @@ static pa_hook_result_t process(struct userdata *u, pa_sink_input *i, bool creat
if (!create)
pa_hashmap_remove(u->cork_state, i);
- if (!(role = pa_proplist_gets(i->proplist, PA_PROP_MEDIA_ROLE)))
- return PA_HOOK_OK;
-
if (!i->sink)
return PA_HOOK_OK;