stream-manager: Enhance codes to get current volume type of sink-input even if there... 42/63242/1 accepted/tizen/ivi/20160323.074240 accepted/tizen/mobile/20160323.074055 accepted/tizen/tv/20160323.074134 accepted/tizen/wearable/20160323.074205 submit/tizen/20160323.050853
authorSangchul Lee <sc11.lee@samsung.com>
Wed, 23 Mar 2016 01:58:06 +0000 (10:58 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Wed, 23 Mar 2016 01:59:14 +0000 (10:59 +0900)
[Version] 5.0.37
[Profile] Common
[Issue Type] Bug fix

Change-Id: I28a41f33a38a1b4adaaac60810155e88fdca9d78

packaging/pulseaudio-modules-tizen.spec
src/stream-manager.c

index 92f614b..eeb77be 100644 (file)
@@ -1,6 +1,6 @@
 Name:             pulseaudio-modules-tizen
 Summary:          Pulseaudio modules for Tizen
-Version:          5.0.36
+Version:          5.0.37
 Release:          0
 Group:            Multimedia/Audio
 License:          LGPL-2.1+
index ac7ed3b..d1284b2 100644 (file)
@@ -1038,6 +1038,7 @@ static void handle_get_current_volume_type(DBusConnection *conn, DBusMessage *ms
     stream_type_t stream_type = STREAM_SINK_INPUT;
     DBusMessage *reply = NULL;
     pa_stream_manager *m = (pa_stream_manager*)userdata;
+    uint32_t idx = 0;
 
     pa_assert(conn);
     pa_assert(msg);
@@ -1060,9 +1061,18 @@ static void handle_get_current_volume_type(DBusConnection *conn, DBusMessage *ms
         goto FAILURE;
     }
 
-    s = (stream_type == STREAM_SINK_INPUT) ? (void*)(m->cur_highest_priority.sink_input) : (void*)(m->cur_highest_priority.source_output);
-    if (s) {
+    if ((s = (stream_type == STREAM_SINK_INPUT) ? (void*)(m->cur_highest_priority.sink_input) : (void*)(m->cur_highest_priority.source_output)))
         type = pa_proplist_gets(GET_STREAM_PROPLIST(s, stream_type), PA_PROP_MEDIA_TIZEN_VOLUME_TYPE);
+    else {
+        if (pa_idxset_size(m->core->sink_inputs)) {
+            PA_IDXSET_FOREACH(s, m->core->sink_inputs, idx) {
+                if ((type = pa_proplist_gets(GET_STREAM_PROPLIST(s, STREAM_SINK_INPUT), PA_PROP_MEDIA_TIZEN_VOLUME_TYPE)))
+                    break;
+            }
+        }
+    }
+
+    if (type) {
         pa_assert_se(dbus_message_append_args(reply, DBUS_TYPE_STRING, &type, DBUS_TYPE_INVALID));
         pa_assert_se(dbus_message_append_args(reply, DBUS_TYPE_STRING, &stream_manager_dbus_ret_str[RET_MSG_INDEX_OK], DBUS_TYPE_INVALID));
     } else {