#define GET_FOCUS_STATUS(focus, type) \
(type == STREAM_SINK_INPUT ? (focus & STREAM_FOCUS_ACQUIRED_PLAYBACK) : (focus & STREAM_FOCUS_ACQUIRED_CAPTURE))
+#define CHECK_STREAM_UNLINKED(stream, type) \
+ (type == STREAM_SINK_INPUT ? ((pa_sink_input*)stream)->unlinked : ((pa_source_output*)stream)->unlinked)
+
#define CHECK_STREAM_RUNNING(stream, type) \
(type == STREAM_SINK_INPUT ? ((pa_sink_input*)stream)->state == PA_SINK_INPUT_RUNNING : ((pa_source_output*)stream)->state == PA_SOURCE_OUTPUT_RUNNING)
PA_IDXSET_FOREACH(i, streams, idx) {
if (command == PROCESS_COMMAND_CHANGE_ROUTE_BY_STREAM_ENDED && i == mine)
continue;
+ if (!CHECK_STREAM_RUNNING(i, type) || CHECK_STREAM_UNLINKED(i, type))
+ continue;
if (!(_role = pa_proplist_gets(GET_STREAM_PROPLIST(i, type), PA_PROP_MEDIA_ROLE))) {
pa_log_error("failed to pa_proplist_gets() for role");
continue;
goto finish;
}
- pa_proplist_unset(GET_STREAM_PROPLIST(stream, type), PA_PROP_MEDIA_ROLE_PRIORITY);
ret = update_the_highest_priority_stream(m, command, stream, type, role, is_new_data, &need_update);
if (ret == false) {
pa_log_error("could not update the highest priority stream");