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;
}
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;