From 569035eb3737d685c79d33161b9aba98c1cd8598 Mon Sep 17 00:00:00 2001 From: Sangchul Lee Date: Tue, 11 Jun 2019 16:22:17 +0900 Subject: [PATCH] sink-input: Skip rewinding if a ramp was set in case of SET_SOFT_VOLUME This patch is to fix a noise issue in case of unducking with fade in. [Version] 11.1.72 [Issue type] Bug fix Change-Id: Id135b2cc4fac31c2213b9d4cd3eaa16b22d5a601 Signed-off-by: Sangchul Lee --- packaging/pulseaudio.spec | 2 +- src/pulsecore/sink-input.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/packaging/pulseaudio.spec b/packaging/pulseaudio.spec index b3c4ced..4a89c45 100644 --- a/packaging/pulseaudio.spec +++ b/packaging/pulseaudio.spec @@ -3,7 +3,7 @@ Name: pulseaudio Summary: Improved Linux sound server Version: 11.1 -Release: 71 +Release: 72 Group: Multimedia/Audio License: LGPL-2.1 URL: http://pulseaudio.org diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c index 858b4a2..b1a625a 100644 --- a/src/pulsecore/sink-input.c +++ b/src/pulsecore/sink-input.c @@ -1626,8 +1626,18 @@ int pa_sink_input_remove_volume_factor(pa_sink_input *i, const char *key) { pa_sw_cvolume_multiply(&i->soft_volume, &i->real_ratio, &i->volume_factor); +#ifdef TIZEN_VOLUME_RAMP + /* If a ramp was set, skip rewinding. It'll be rewinded with SET_VOLUME_RAMP later. */ + if (pa_cvolume_ramp_target_active(&i->ramp)) { + bool skip_rewind = true; + pa_assert_se(pa_asyncmsgq_send(i->sink->asyncmsgq, PA_MSGOBJECT(i), PA_SINK_INPUT_MESSAGE_SET_SOFT_VOLUME, &skip_rewind, 0, NULL) == 0); + } else { +#endif /* Copy the new soft_volume to the thread_info struct */ pa_assert_se(pa_asyncmsgq_send(i->sink->asyncmsgq, PA_MSGOBJECT(i), PA_SINK_INPUT_MESSAGE_SET_SOFT_VOLUME, NULL, 0, NULL) == 0); +#ifdef TIZEN_VOLUME_RAMP + } +#endif return 0; } @@ -2411,6 +2421,11 @@ int pa_sink_input_process_msg(pa_msgobject *o, int code, void *userdata, int64_t case PA_SINK_INPUT_MESSAGE_SET_SOFT_VOLUME: if (!pa_cvolume_equal(&i->thread_info.soft_volume, &i->soft_volume)) { i->thread_info.soft_volume = i->soft_volume; +#ifdef TIZEN_VOLUME_RAMP + /* Skip rewinding */ + if (userdata && (bool)(*(bool*)userdata) == true) + return 0; +#endif pa_sink_input_request_rewind(i, 0, true, false, false); } return 0; -- 2.7.4