stream-interaction: Add silent sound to the start of a trigger stream if it affects... 82/200982/2
authorSangchul Lee <sc11.lee@samsung.com>
Thu, 7 Mar 2019 01:05:27 +0000 (10:05 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Thu, 7 Mar 2019 03:42:20 +0000 (12:42 +0900)
original patch
 : c2901490ebd4902059cadb244d2143733e6d877d - 2016-09-20 07:55:45 +0900 -
   role-ducking: Add silent sound to the start of a trigger stream if it affects any ducking stream

[Version] 11.1-59
[Issue Type] Add omitted patch

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

index f17033c..92875b0 100644 (file)
@@ -3,7 +3,7 @@
 Name:             pulseaudio
 Summary:          Improved Linux sound server
 Version:          11.1
-Release:          58
+Release:          59
 Group:            Multimedia/Audio
 License:          LGPL-2.1
 URL:              http://pulseaudio.org
index 51d7f04..714330b 100644 (file)
@@ -303,6 +303,14 @@ static void cork_or_duck(struct userdata *u, pa_sink_input *i, const char *inter
             } else {
                 pa_log_debug("Found a '%s' stream(%u) that should be ducked with fade-out(%lums) by '%s'.", interaction_role, i->index, g->fade_durs.out, g->name);
                 pa_sink_input_add_volume_ramp_factor(i, g->name, &vol_ramp, true);
+
+                if (pa_sink_input_get_state(i) == PA_SINK_INPUT_RUNNING) {
+                    if (pa_idxset_size(g->triggered_streams) == 1) {
+                        uint32_t t_idx;
+                        pa_sink_input *si = pa_idxset_first(g->triggered_streams, &t_idx);
+                        pa_sink_input_set_silence_to_first_peek(si, true, g->fade_durs.out * 1000);
+                    }
+                }
             }
         } else {
             pa_cvolume vol;