teach module-rescue-streams and module-always-sink to not do anything if we are shutting down anyway

This commit is contained in:
Lennart Poettering 2009-01-23 22:30:02 +01:00
parent a3162a396e
commit 967c17a190
2 changed files with 17 additions and 1 deletions

View file

@ -54,6 +54,10 @@ static pa_hook_result_t sink_hook_callback(pa_core *c, pa_sink *sink, void* user
pa_assert(c);
pa_assert(sink);
/* There's no point in doing anything if the core is shut down anyway */
if (c->state == PA_CORE_SHUTDOWN)
return PA_HOOK_OK;
if (!pa_idxset_size(sink->inputs)) {
pa_log_debug("No sink inputs to move away.");
return PA_HOOK_OK;
@ -92,6 +96,10 @@ static pa_hook_result_t source_hook_callback(pa_core *c, pa_source *source, void
pa_assert(c);
pa_assert(source);
/* There's no point in doing anything if the core is shut down anyway */
if (c->state == PA_CORE_SHUTDOWN)
return PA_HOOK_OK;
if (!pa_idxset_size(source->outputs)) {
pa_log_debug("No source outputs to move away.");
return PA_HOOK_OK;