stream-manager: Fix bug in sink_input_ramp_finish_cb 27/216927/2 accepted/tizen/unified/20191105.110652 submit/tizen/20191105.051822
authorJeongmo Yang <jm80.yang@samsung.com>
Tue, 5 Nov 2019 03:25:22 +0000 (12:25 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Tue, 5 Nov 2019 04:38:43 +0000 (13:38 +0900)
- If two or more duckings are activated to the same stream,
  only the first ducking state changed callback is invoked.

[Version] 11.1.85
[Profile] Common
[Issue Type] Bug fix

Change-Id: I2f043030aa7f339f42fc6176442974286c33c605
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
packaging/pulseaudio-modules-tizen.spec
src/stream-manager-dbus.c
src/stream-manager.c

index 8029317..f55bed1 100644 (file)
@@ -1,6 +1,6 @@
 Name:             pulseaudio-modules-tizen
 Summary:          Pulseaudio modules for Tizen
-Version:          11.1.84
+Version:          11.1.85
 Release:          0
 Group:            Multimedia/Audio
 License:          LGPL-2.1+
index 1e2a44f..5698015 100644 (file)
@@ -1931,7 +1931,6 @@ static void handle_activate_ducking(DBusConnection *conn, DBusMessage *msg, void
             } else {
                 pa_sink_input_add_volume_ramp_factor(i, sd->vol_key, &vol_ramp, true);
             }
-
         } else {
             pa_log_info("unducking: remove volume(ramp) factor, key[%s] from stream[idx:%u]",
                 sd->vol_key, i->index);
@@ -1946,7 +1945,7 @@ static void handle_activate_ducking(DBusConnection *conn, DBusMessage *msg, void
         memset(&sd->vol_key, 0, sizeof(sd->vol_key));
     }
 
-    pa_log_info("ducking stream count(%d)", sd->ducking_stream_count);
+    pa_log_info("ducking stream count(%p,%d)", sd, sd->ducking_stream_count);
 
     pa_assert_se(dbus_message_append_args(reply, DBUS_TYPE_STRING, &stream_manager_dbus_ret_str[RET_MSG_OK], DBUS_TYPE_INVALID));
 
@@ -1991,7 +1990,7 @@ static void handle_get_ducking_state(DBusConnection *conn, DBusMessage *msg, voi
     /* get stream_ducking */
     pa_assert_se((sd = pa_hashmap_get(m->stream_duckings, (const void*)id)));
 
-    pa_log_info("id[%u], is_ducked[%u]", id, sd->is_ducked);
+    pa_log_info("id[%u], is_ducked[%p,%u]", id, sd, sd->is_ducked);
 
     pa_assert_se(dbus_message_append_args(reply, DBUS_TYPE_BOOLEAN, &sd->is_ducked, DBUS_TYPE_INVALID));
     pa_assert_se(dbus_message_append_args(reply, DBUS_TYPE_STRING, &stream_manager_dbus_ret_str[RET_MSG_OK], DBUS_TYPE_INVALID));
index 6d16d6a..bc49ef7 100644 (file)
@@ -2558,8 +2558,8 @@ static pa_hook_result_t sink_input_ramp_finish_cb(pa_core *core, pa_sink_input *
      * then broadcast a signal with context id.*/
     PA_HASHMAP_FOREACH(sd, m->stream_duckings, state) {
         PA_IDXSET_FOREACH(stream, sd->idx_ducking_streams, idx) {
-            if (stream == i) {
-                pa_log_info("matched");
+            if (stream == i && sd->ducking_stream_count > 0) {
+                pa_log_info("matched (%p,%p)", sd, i);
                 break;
             }
         }
@@ -2583,7 +2583,7 @@ static pa_hook_result_t sink_input_ramp_finish_cb(pa_core *core, pa_sink_input *
      * Note that the condition of increasing count value below is located in
      * handle_activate_ducking() of DBus handler. */
     if (sd->ducking_stream_count > 0 && --sd->ducking_stream_count == 0) {
-        pa_log_info("send signal for ramp finished - is_ducked(%d)", is_ducked);
+        pa_log_info("send signal for ramp finished - is_ducked(%p,%d)", sd, is_ducked);
         sd->is_ducked = is_ducked;
         send_ducking_state_changed_signal(pa_dbus_connection_get(m->dbus_conn), sd->trigger_index, sd->is_ducked);
     }