stream-manager-dbus: Fix bug of error case 79/202979/1
authorSangchul Lee <sc11.lee@samsung.com>
Mon, 8 Apr 2019 08:00:54 +0000 (17:00 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Mon, 8 Apr 2019 08:50:25 +0000 (17:50 +0900)
Invalid parameters of dbus_message_append_args() are fixed.

[Version] 11.1.38
[Issue type] Bug fix

Change-Id: I2c03e3690780a468d076f4b12581f5ffd3249529
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/pulseaudio-modules-tizen.spec
src/stream-manager-dbus-priv.h
src/stream-manager-dbus.c

index dbf0505..2c5a0ce 100644 (file)
@@ -1,6 +1,6 @@
 Name:             pulseaudio-modules-tizen
 Summary:          Pulseaudio modules for Tizen
-Version:          11.1.37
+Version:          11.1.38
 Release:          0
 Group:            Multimedia/Audio
 License:          LGPL-2.1+
index f0447fe..019cf9c 100644 (file)
@@ -101,8 +101,8 @@ pa_dbus_interface_info stream_manager_interface_info = {
     "   <arg name=\"avail_frameworks\" direction=\"out\" type=\"as\"/>"      \
     "  </method>"                                                            \
     "  <method name=\"STREAM_MANAGER_METHOD_NAME_GET_STREAM_LIST\">"         \
-    "   <arg name=\"stream_type\" direction=\"in\" type=\"as\"/>"            \
-    "   <arg name=\"priority\" direction=\"in\" type=\"ai\"/>"               \
+    "   <arg name=\"stream_type\" direction=\"out\" type=\"as\"/>"           \
+    "   <arg name=\"priority\" direction=\"out\" type=\"ai\"/>"              \
     "  </method>"                                                            \
     "  <method name=\"STREAM_MANAGER_METHOD_NAME_SET_STREAM_ROUTE_DEVICES\">"\
     "   <arg name=\"parent_id\" direction=\"in\" type=\"u\"/>"               \
index 5c402ec..7afa05b 100644 (file)
@@ -622,13 +622,13 @@ static void handle_get_volume_level(DBusConnection *conn, DBusMessage *msg, void
     else if (pa_safe_streq(direction, "out"))
         stream_type = STREAM_SINK_INPUT;
     else {
-        pa_assert_se(dbus_message_append_args(reply, DBUS_TYPE_UINT32, 0, DBUS_TYPE_INVALID));
+        pa_assert_se(dbus_message_append_args(reply, DBUS_TYPE_UINT32, &level, DBUS_TYPE_INVALID));
         pa_assert_se(dbus_message_append_args(reply, DBUS_TYPE_STRING, &stream_manager_dbus_ret_str[RET_MSG_ERROR_INTERNAL], DBUS_TYPE_INVALID));
         goto finish;
     }
 
     if (get_volume_level_by_type(m, GET_VOLUME_CURRENT_LEVEL, stream_type, type, &level)) {
-        pa_assert_se(dbus_message_append_args(reply, DBUS_TYPE_UINT32, 0, DBUS_TYPE_INVALID));
+        pa_assert_se(dbus_message_append_args(reply, DBUS_TYPE_UINT32, &level, DBUS_TYPE_INVALID));
         pa_assert_se(dbus_message_append_args(reply, DBUS_TYPE_STRING, &stream_manager_dbus_ret_str[RET_MSG_ERROR_INTERNAL], DBUS_TYPE_INVALID));
     } else {
         pa_assert_se(dbus_message_append_args(reply, DBUS_TYPE_UINT32, &level, DBUS_TYPE_INVALID));
@@ -665,13 +665,13 @@ static void handle_get_volume_max_level(DBusConnection *conn, DBusMessage *msg,
     else if (pa_safe_streq(direction, "out"))
         stream_type = STREAM_SINK_INPUT;
     else {
-        pa_assert_se(dbus_message_append_args(reply, DBUS_TYPE_UINT32, 0, DBUS_TYPE_INVALID));
+        pa_assert_se(dbus_message_append_args(reply, DBUS_TYPE_UINT32, &level, DBUS_TYPE_INVALID));
         pa_assert_se(dbus_message_append_args(reply, DBUS_TYPE_STRING, &stream_manager_dbus_ret_str[RET_MSG_ERROR_INTERNAL], DBUS_TYPE_INVALID));
         goto finish;
     }
 
     if (get_volume_level_by_type(m, GET_VOLUME_MAX_LEVEL, stream_type, type, &level)) {
-        pa_assert_se(dbus_message_append_args(reply, DBUS_TYPE_UINT32, 0, DBUS_TYPE_INVALID));
+        pa_assert_se(dbus_message_append_args(reply, DBUS_TYPE_UINT32, &level, DBUS_TYPE_INVALID));
         pa_assert_se(dbus_message_append_args(reply, DBUS_TYPE_STRING, &stream_manager_dbus_ret_str[RET_MSG_ERROR_INTERNAL], DBUS_TYPE_INVALID));
     } else {
         pa_assert_se(dbus_message_append_args(reply, DBUS_TYPE_UINT32, &level, DBUS_TYPE_INVALID));
@@ -754,13 +754,13 @@ static void handle_get_volume_mute(DBusConnection *conn, DBusMessage *msg, void
     else if (pa_safe_streq(direction, "out"))
         stream_type = STREAM_SINK_INPUT;
     else {
-        pa_assert_se(dbus_message_append_args(reply, DBUS_TYPE_UINT32, 0, DBUS_TYPE_INVALID));
+        pa_assert_se(dbus_message_append_args(reply, DBUS_TYPE_UINT32, &is_muted, DBUS_TYPE_INVALID));
         pa_assert_se(dbus_message_append_args(reply, DBUS_TYPE_STRING, &stream_manager_dbus_ret_str[RET_MSG_ERROR_INTERNAL], DBUS_TYPE_INVALID));
         goto fail;
     }
 
     if (get_volume_mute_by_type(m, stream_type, type, (bool*)&is_muted)) {
-        pa_assert_se(dbus_message_append_args(reply, DBUS_TYPE_UINT32, 0, DBUS_TYPE_INVALID));
+        pa_assert_se(dbus_message_append_args(reply, DBUS_TYPE_UINT32, &is_muted, DBUS_TYPE_INVALID));
         pa_assert_se(dbus_message_append_args(reply, DBUS_TYPE_STRING, &stream_manager_dbus_ret_str[RET_MSG_ERROR_INTERNAL], DBUS_TYPE_INVALID));
     } else {
         pa_assert_se(dbus_message_append_args(reply, DBUS_TYPE_UINT32, &is_muted, DBUS_TYPE_INVALID));