stream-manager: Ensure sending ducking changed signal even when unlinking sink-input... 56/210856/2 accepted/tizen/unified/20190729.081033 submit/tizen/20190726.021654 submit/tizen/20190728.111739
authorSangchul Lee <sc11.lee@samsung.com>
Thu, 25 Jul 2019 07:44:57 +0000 (16:44 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Thu, 25 Jul 2019 08:49:32 +0000 (17:49 +0900)
Even though a sink-input affected by ducking DBus method is unlinking
in the middle of ducking or unducking process by ramp factor, the DBus
signal for ducking changed callback should be emitted properly.
This patch checks some conditions and emits the signal in that case.

[Version] 11.1.66
[Issue type] Improvement

Change-Id: Iab46f03af623f204ba351fa83941a2a03e77b4d3
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/pulseaudio-modules-tizen.spec
src/stream-manager.c

index 4eb7764..14512a4 100644 (file)
@@ -1,6 +1,6 @@
 Name:             pulseaudio-modules-tizen
 Summary:          Pulseaudio modules for Tizen
-Version:          11.1.65
+Version:          11.1.66
 Release:          0
 Group:            Multimedia/Audio
 License:          LGPL-2.1+
index 667fd50..24b7afe 100644 (file)
@@ -2250,12 +2250,17 @@ static void remove_sink_input_from_ducking_streams(pa_stream_manager *m, pa_sink
 
     PA_HASHMAP_FOREACH(sd, m->stream_duckings, state) {
         PA_IDXSET_FOREACH(stream, sd->idx_ducking_streams, idx) {
-            if (stream == i) {
-                pa_log_info("remove stream(idx:%u,%p) from idx_ducking_streams, trigger_index(%u)",
-                    i->index, i, sd->trigger_index);
-                pa_idxset_remove_by_data(sd->idx_ducking_streams, stream, NULL);
-                return;
-            }
+            if (stream != i)
+                continue;
+
+            if ((strlen(sd->target_role) && !sd->is_ducked) ||
+                (!strlen(sd->target_role) && sd->is_ducked))
+                pa_hook_fire(&i->core->hooks[PA_CORE_HOOK_SINK_INPUT_RAMP_FINISH], i);
+
+            pa_log_info("remove stream(idx:%u,%p) from idx_ducking_streams, trigger_index(%u)",
+                i->index, i, sd->trigger_index);
+            pa_idxset_remove_by_data(sd->idx_ducking_streams, stream, NULL);
+            return;
         }
     }
 }