[pulseaudio-commits] src/modules

Tanu Kaskinen tanuk at kemper.freedesktop.org
Fri Mar 18 08:14:54 UTC 2016


 src/modules/stream-interaction.c |   18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

New commits:
commit 4731690a21edc59acfd0bd27f810d5c895ac7629
Author: Georg Chini <georg at chini.tk>
Date:   Thu Mar 17 22:35:05 2016 +0100

    stream-interaction: Bugfix for improper uncorking behavior with global=1
    
    This patch is based on a recent patch for module-role-ducking from Sangchul Lee
    which fixes incorrect behavior when global is set to 1. Original commit can be found
    here:
    https://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=d049c2941e6aef5ff33bcd0b4adece12289302b7

diff --git a/src/modules/stream-interaction.c b/src/modules/stream-interaction.c
index 814ab83..00e4d6d 100644
--- a/src/modules/stream-interaction.c
+++ b/src/modules/stream-interaction.c
@@ -84,6 +84,22 @@ static const char *find_trigger_stream(struct userdata *u, pa_sink *s, pa_sink_i
     return NULL;
 }
 
+static const char *find_global_trigger_stream(struct userdata *u, pa_sink *s, pa_sink_input *ignore) {
+    const char *trigger_role = NULL;
+
+    pa_assert(u);
+
+    if (u->global) {
+        uint32_t idx;
+        PA_IDXSET_FOREACH(s, u->core->sinks, idx)
+            if ((trigger_role = find_trigger_stream(u, s, ignore)))
+                break;
+    } else
+        trigger_role = find_trigger_stream(u, s, ignore);
+
+    return trigger_role;
+}
+
 static void cork_stream(struct userdata *u, pa_sink_input *i, const char *interaction_role, const char *trigger_role) {
 
     pa_log_debug("Found a '%s' stream that corks/mutes a '%s' stream.", trigger_role, interaction_role);
@@ -190,7 +206,7 @@ static pa_hook_result_t process(struct userdata *u, pa_sink_input *i, bool creat
     if (!i->sink)
         return PA_HOOK_OK;
 
-    trigger_role = find_trigger_stream(u, i->sink, create ? NULL : i);
+    trigger_role = find_global_trigger_stream(u, i->sink, create ? NULL : i);
     apply_interaction(u, i->sink, trigger_role, create ? NULL : i);
 
     return PA_HOOK_OK;



More information about the pulseaudio-commits mailing list