stream-manager: Update routing path even if requested device list is empty in case... 90/120290/3 accepted/tizen_3.0_common accepted/tizen_3.0_ivi accepted/tizen_3.0_mobile accepted/tizen_3.0_tv accepted/tizen_3.0_wearable accepted/tizen/3.0/common/20170330.125002 accepted/tizen/3.0/ivi/20170329.223033 accepted/tizen/3.0/mobile/20170329.222934 accepted/tizen/3.0/tv/20170329.222952 accepted/tizen/3.0/wearable/20170329.223014 submit/tizen_3.0/20170329.043647
authorSangchul Lee <sc11.lee@samsung.com>
Wed, 22 Mar 2017 07:32:49 +0000 (16:32 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Thu, 23 Mar 2017 08:40:46 +0000 (17:40 +0900)
In case of manual routing, some conditions are changed to trigger to update routing path
even if requested device list is empty that means to remove previous one with same direction.
This can be executed only if it is occupied stream.

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

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

index 25d018d..ac5fc7d 100644 (file)
@@ -1,6 +1,6 @@
 Name:             pulseaudio-modules-tizen
 Summary:          Pulseaudio modules for Tizen
-Version:          5.0.141
+Version:          5.0.142
 Release:          0
 Group:            Multimedia/Audio
 License:          LGPL-2.1+
index aaade9d..de28fc9 100644 (file)
@@ -1013,7 +1013,6 @@ static void update_devices_and_trigger_routing(pa_stream_manager *m, stream_pare
     pa_idxset *idx_streams = NULL;
     uint32_t idx = 0;
     void *cur_highest_priority_stream = NULL;
-    focus_acquired_status_t acquired_status = STREAM_FOCUS_ACQUIRED_NONE;
     stream_route_type_t route_type = STREAM_ROUTE_TYPE_DEFAULT;
 
     pa_assert(m);
@@ -1022,11 +1021,9 @@ static void update_devices_and_trigger_routing(pa_stream_manager *m, stream_pare
     if (type == STREAM_SINK_INPUT) {
         idx_streams = sp->idx_sink_inputs;
         cur_highest_priority_stream = (void*)m->cur_highest_priority.sink_input;
-        acquired_status = STREAM_FOCUS_ACQUIRED_PLAYBACK;
     } else {
         idx_streams = sp->idx_source_outputs;
         cur_highest_priority_stream = (void*)m->cur_highest_priority.source_output;
-        acquired_status = STREAM_FOCUS_ACQUIRED_CAPTURE;
     }
 
     /* update route type of this stream parent */
@@ -1054,9 +1051,9 @@ static void update_devices_and_trigger_routing(pa_stream_manager *m, stream_pare
                         GET_STREAM_INDEX(stream, type), sp);
             do_notify(m, NOTIFY_COMMAND_SELECT_PROPER_SINK_OR_SOURCE_FOR_INIT, type, false, stream);
         }
-    } else if (cur_highest_priority_stream) {
-        /* trigger only when the stream parent has focus */
-        if ((sp->focus_status & acquired_status) && pa_idxset_get_by_data(idx_streams, cur_highest_priority_stream, NULL)) {
+    } else {
+        /* trigger only when it occupies routing path */
+        if (cur_highest_priority_stream && pa_idxset_get_by_data(idx_streams, cur_highest_priority_stream, NULL)) {
             pa_log_debug(" -- cur_highest_priority_stream->index[%u] belongs to this stream_parent[%p], do notify for the route change",
                         GET_STREAM_INDEX(cur_highest_priority_stream, type), sp);
             do_notify(m, NOTIFY_COMMAND_CHANGE_ROUTE_START, type, false, cur_highest_priority_stream);
@@ -2838,8 +2835,8 @@ BREAK_WITH_FREE:
             fill_device_info_to_hook_data(m, &hook_call_route_data, command, type, s, is_new_data);
             if (hook_call_route_data.route_type >= STREAM_ROUTE_TYPE_MANUAL) {
                 if (hook_call_route_data.idx_manual_devices && !pa_idxset_size(hook_call_route_data.idx_manual_devices)) {
-                    pa_log_warn("no manual device for this type(%d), skip it..", type);
-                    break;
+                    pa_log_warn("no manual device for this type(%d)", type);
+                    hook_call_route_data.stream = NULL;
                 }
             }
             pa_hook_fire(pa_communicator_hook(m->comm.comm, PA_COMMUNICATOR_HOOK_CHANGE_ROUTE), &hook_call_route_data);
@@ -3630,7 +3627,7 @@ static void process_stream_as_device_change_for_auto_route(pa_stream_manager *m,
                                                            bool is_connected, pa_tz_device *device) {
     stream_route_type_t route_type;
     const char *device_type;
-    bool use_internal_codec;
+    bool use_internal_codec = false;
 
     pa_assert(m);
     pa_assert(stream);