memset(&route_option, 0, sizeof(hal_route_option));
s = (type == STREAM_SINK_INPUT) ? (void*)(m->cur_highest_priority.sink_input) :
(void*)(m->cur_highest_priority.source_output);
- if (s) {
+ /* route_option.role can be null if there's no occupied stream */
+ if (s)
route_option.role = (type == STREAM_SINK_INPUT) ? (m->cur_highest_priority.role_si) :
- (m->cur_highest_priority.role_so);
- route_option.name = ((stream_route_option*)user_data)->name;
- route_option.value = ((stream_route_option*)user_data)->value;
- if (pa_hal_interface_update_route_option(m->hal, &route_option))
- ret = RET_MSG_ERROR_INTERNAL;
- } else {
- pa_log_warn("there's no occupied stream, skip updating route option");
- ret = RET_MSG_ERROR_NO_STREAM;
- }
+ (m->cur_highest_priority.role_so);
+ route_option.name = ((stream_route_option*)user_data)->name;
+ route_option.value = ((stream_route_option*)user_data)->value;
+ if (pa_hal_interface_update_route_option(m->hal, &route_option))
+ ret = RET_MSG_ERROR_INTERNAL;
break;
}
case NOTIFY_COMMAND_INFORM_STREAM_CONNECTED: