sink-input: Skip rewinding if a ramp was set in case of SET_SOFT_VOLUME 47/207747/2 accepted/tizen/unified/20190621.121840 submit/tizen/20190619.053430 submit/tizen/20190620.095920
authorSangchul Lee <sc11.lee@samsung.com>
Tue, 11 Jun 2019 07:22:17 +0000 (16:22 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Wed, 12 Jun 2019 02:19:31 +0000 (11:19 +0900)
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 <sc11.lee@samsung.com>
packaging/pulseaudio.spec
src/pulsecore/sink-input.c

index b3c4ced..4a89c45 100644 (file)
@@ -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
index 858b4a2..b1a625a 100644 (file)
@@ -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;