diff options
| author | Lennart Poettering <lennart@poettering.net> | 2009-01-23 22:30:02 +0100 | 
|---|---|---|
| committer | Lennart Poettering <lennart@poettering.net> | 2009-01-23 22:30:02 +0100 | 
| commit | 967c17a1900b7547e471c9f1399107fc8287fcdc (patch) | |
| tree | 9e4a71d5ef1a669349d5d6d856f239e41e29fec2 | |
| parent | a3162a396e2344b9e48fe27e406e5d92ba94af9b (diff) | |
teach module-rescue-streams and module-always-sink to not do anything if we are shutting down anyway
| -rw-r--r-- | src/modules/module-always-sink.c | 10 | ||||
| -rw-r--r-- | src/modules/module-rescue-streams.c | 8 | 
2 files changed, 17 insertions, 1 deletions
diff --git a/src/modules/module-always-sink.c b/src/modules/module-always-sink.c index cd3f3112..591695fb 100644 --- a/src/modules/module-always-sink.c +++ b/src/modules/module-always-sink.c @@ -100,6 +100,10 @@ static pa_hook_result_t put_hook_callback(pa_core *c, pa_sink *sink, void* userd      if (u->ignore)          return PA_HOOK_OK; +    /* There's no point in doing anything if the core is shut down anyway */ +    if (c->state == PA_CORE_SHUTDOWN) +        return PA_HOOK_OK; +      /* Auto-loaded null-sink not active, so ignoring newly detected sink. */      if (u->null_module == PA_INVALID_INDEX)          return PA_HOOK_OK; @@ -130,6 +134,10 @@ static pa_hook_result_t unlink_hook_callback(pa_core *c, pa_sink *sink, void* us          return PA_HOOK_OK;      } +    /* There's no point in doing anything if the core is shut down anyway */ +    if (c->state == PA_CORE_SHUTDOWN) +        return PA_HOOK_OK; +      load_null_sink_if_needed(c, sink, u);      return PA_HOOK_OK; @@ -172,7 +180,7 @@ void pa__done(pa_module*m) {          pa_hook_slot_free(u->put_slot);      if (u->unlink_slot)          pa_hook_slot_free(u->unlink_slot); -    if (u->null_module != PA_INVALID_INDEX) +    if (u->null_module != PA_INVALID_INDEX && m->core->state != PA_CORE_SHUTDOWN)          pa_module_unload_request_by_index(m->core, u->null_module, TRUE);      pa_xfree(u->sink_name); diff --git a/src/modules/module-rescue-streams.c b/src/modules/module-rescue-streams.c index de07225d..07a0237f 100644 --- a/src/modules/module-rescue-streams.c +++ b/src/modules/module-rescue-streams.c @@ -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;  | 
