diff --git a/src/modules/module-stream-restore.c b/src/modules/module-stream-restore.c index 6c7b4c75b..cbef4782d 100644 --- a/src/modules/module-stream-restore.c +++ b/src/modules/module-stream-restore.c @@ -1459,8 +1459,10 @@ static pa_hook_result_t sink_input_new_hook_callback(pa_core *c, pa_sink_input_n same time, in which case we want to make sure we don't interfere with that */ if (s && PA_SINK_IS_LINKED(s->state)) - if (pa_sink_input_new_data_set_sink(new_data, s, true, false)) - pa_log_info("Restoring device for stream %s.", name); + if (!s->active_port || s->active_port->available != PA_AVAILABLE_NO) { + if (pa_sink_input_new_data_set_sink(new_data, s, true, false)) + pa_log_info("Restoring device for stream %s.", name); + } entry_free(e); } @@ -1562,8 +1564,10 @@ static pa_hook_result_t source_output_new_hook_callback(pa_core *c, pa_source_ou same time, in which case we want to make sure we don't interfere with that */ if (s && PA_SOURCE_IS_LINKED(s->state)) { - pa_log_info("Restoring device for stream %s.", name); - pa_source_output_new_data_set_source(new_data, s, true, false); + if (!s->active_port || s->active_port->available != PA_AVAILABLE_NO) { + pa_log_info("Restoring device for stream %s.", name); + pa_source_output_new_data_set_source(new_data, s, true, false); + } } entry_free(e);