role-ducking: Add silent sound to the start of a trigger stream if it affects any... 61/88461/3
authorSangchul Lee <sc11.lee@samsung.com>
Mon, 19 Sep 2016 07:31:50 +0000 (16:31 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Mon, 19 Sep 2016 22:55:45 +0000 (07:55 +0900)
A ducking stream's volume will be decreased before starting original data of the trigger stream.

Here's the condition for the activation of it.
1. When a trigger stream belongs to a group that has fading feature,
2. Any ducking stream of the group is currently running.
3. Adding silent sound will be operated when starting the trigger stream.

[Version] 5.0-91
[Profile] Common
[Issue Type] New feature

Change-Id: Ie5ac6cc34d5597c067099d4f44a01fb5c07ca41d
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/pulseaudio.spec
src/modules/module-role-ducking.c

index 0305a67..5d65d45 100644 (file)
@@ -11,7 +11,7 @@
 Name:             pulseaudio
 Summary:          Improved Linux sound server
 Version:          5.0
-Release:          90
+Release:          91
 Group:            Multimedia/Audio
 License:          LGPL-2.1+
 URL:              http://pulseaudio.org
index 90c1e79..5186e9d 100644 (file)
@@ -227,6 +227,16 @@ static void apply_ducking_to_sink(struct userdata *u, pa_sink *s, pa_sink_input
                                  ducking_role, j->index, g->fade_durs.out, g->name);
 
                     pa_sink_input_set_volume_ramp(j, &vol_ramp, true, false);
+
+                    if (!exist && (pa_sink_input_get_state(j) == PA_SINK_INPUT_RUNNING)) {
+                        pa_sink_input *si = NULL;
+                        uint32_t t_idx;
+                        PA_IDXSET_FOREACH(si, g->triggered_inputs, t_idx)
+                           if (si) {
+                                pa_sink_input_set_silence_to_first_peek(si, true, g->fade_durs.out * 1000);
+                                break;
+                           }
+                    }
                 }
             } else {
                 pa_cvolume vol;