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);
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 */
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);
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);
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);