}
} 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))) {
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))) {
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);
}
}