stream-manager: roll-back of the previous commit and add condition for selecting... 79/91579/1 accepted/tizen/common/20161012.154149 accepted/tizen/ivi/20161012.065402 accepted/tizen/mobile/20161012.065244 accepted/tizen/tv/20161012.065313 accepted/tizen/wearable/20161012.065335 submit/tizen/20161012.010406
authorSangchul Lee <sc11.lee@samsung.com>
Mon, 10 Oct 2016 08:44:50 +0000 (17:44 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Mon, 10 Oct 2016 09:01:52 +0000 (18:01 +0900)
Although A2DP of BT device is off and it changes to SCO, the sink from the deivce should be same as BT sink(for A2DP).
Because it does not work like that, new condition is added to avoid it temporarily.

[Version] 5.0.85
[Profile] Common
[Issue Type] Fix bug

Change-Id: I23f30484d92890e9870ffbefadd0b6db5eb6c12a

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

index a06cef8..62a4d2d 100644 (file)
@@ -1,6 +1,6 @@
 Name:             pulseaudio-modules-tizen
 Summary:          Pulseaudio modules for Tizen
-Version:          5.0.84
+Version:          5.0.85
 Release:          0
 Group:            Multimedia/Audio
 License:          LGPL-2.1+
index 30e3238..eb48168 100644 (file)
@@ -3179,7 +3179,10 @@ static void update_sink_or_source_as_device_change(stream_route_type_t stream_ro
                     }
                 } else if (!is_connected) {
                     /* DISCONNECTED: find a connected device that has the next priority */
-                    if (sink) {
+                    if (sink && (sink == ((pa_sink_input*)s)->sink) ||
+                      /* FIX ME: Although A2DP of BT device is off and it changes to SCO, sink from the device should be same as BT sink(for A2DP).
+                       * Because it does not work like that, new condition is added to avoid it temporarily. */
+                        (pa_safe_streq(device_type, DEVICE_TYPE_BT) && pa_safe_streq(pa_tz_device_get_profile(device), "sco"))) {
                         find_next_device_for_auto_route(m, route_type, role, stream_type, device_type, &next_device);
                         if (next_device) {
                             if ((next_sink = pa_tz_device_get_sink(next_device, DEVICE_ROLE_NORMAL))) {
@@ -3200,11 +3203,11 @@ static void update_sink_or_source_as_device_change(stream_route_type_t stream_ro
 
                         if (!next_device || !next_sink) {
                             pa_sink_input_move_to(s, null_sink, false);
-                            pa_log_debug("  -- *** sink-input(%p,%u) moves to sink(%p,%s)",
+                            pa_log_warn("  -- *** sink-input(%p,%u) moves to sink(%p,%s)",
                                 s, ((pa_sink_input*)s)->index, null_sink, null_sink->name);
                         }
 
-                    } else if (source) {
+                    } else if (source && (source == ((pa_source_output*)s)->source)) {
                         find_next_device_for_auto_route(m, route_type, role, stream_type, device_type, &next_device);
                         if (next_device) {
                             if ((next_source = pa_tz_device_get_source(next_device, DEVICE_ROLE_NORMAL))) {
@@ -3218,7 +3221,7 @@ static void update_sink_or_source_as_device_change(stream_route_type_t stream_ro
                                     process_stream_as_device_change_for_auto_route(m, s, stream_type, is_connected, next_source->use_internal_codec);
 
                                 pa_source_output_move_to(s, next_source, false);
-                                pa_log_debug("  -- *** source-output(%p,%u) moves to source(%p,%s), new device(%s)",
+                                pa_log_warn("  -- *** source-output(%p,%u) moves to source(%p,%s), new device(%s)",
                                              s, ((pa_source_output*)s)->index, next_source, next_source->name, new_device_type);
                                 }
                         }