From c2901490ebd4902059cadb244d2143733e6d877d Mon Sep 17 00:00:00 2001 From: Sangchul Lee Date: Mon, 19 Sep 2016 16:31:50 +0900 Subject: [PATCH] role-ducking: Add silent sound to the start of a trigger stream if it affects any ducking stream 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 --- packaging/pulseaudio.spec | 2 +- src/modules/module-role-ducking.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packaging/pulseaudio.spec b/packaging/pulseaudio.spec index 0305a67..5d65d45 100644 --- a/packaging/pulseaudio.spec +++ b/packaging/pulseaudio.spec @@ -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 diff --git a/src/modules/module-role-ducking.c b/src/modules/module-role-ducking.c index 90c1e79..5186e9d 100644 --- a/src/modules/module-role-ducking.c +++ b/src/modules/module-role-ducking.c @@ -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; -- 2.7.4