summaryrefslogtreecommitdiffstats
path: root/src/modules/module-stream-restore.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-08-16 00:45:23 +0200
committerLennart Poettering <lennart@poettering.net>2009-08-16 00:45:23 +0200
commit4c29ba9c332dd682ced5ed668aede16aa5861128 (patch)
treec0e71f7bd470def7bbd9f97419dd5037f7f82cc4 /src/modules/module-stream-restore.c
parent2a39663ab61614982c52e244bde596dcc1a08f37 (diff)
modules: add various checks to avoid selecting objects that are not linked or in another unclear state
Diffstat (limited to 'src/modules/module-stream-restore.c')
-rw-r--r--src/modules/module-stream-restore.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/modules/module-stream-restore.c b/src/modules/module-stream-restore.c
index 727a5275..e560bd28 100644
--- a/src/modules/module-stream-restore.c
+++ b/src/modules/module-stream-restore.c
@@ -540,6 +540,11 @@ static pa_hook_result_t sink_put_hook_callback(pa_core *c, pa_sink *sink, struct
if (si->save_sink)
continue;
+ /* Skip this if it is already in the process of being moved
+ * anyway */
+ if (!si->sink)
+ continue;
+
/* It might happen that a stream and a sink are set up at the
same time, in which case we want to make sure we don't
interfere with that */
@@ -584,6 +589,10 @@ static pa_hook_result_t source_put_hook_callback(pa_core *c, pa_source *source,
if (so->direct_on_input)
continue;
+ /* Skip this if it is already in the process of being moved anyway */
+ if (!so->source)
+ continue;
+
/* It might happen that a stream and a sink are set up at the
same time, in which case we want to make sure we don't
interfere with that */
@@ -623,6 +632,9 @@ static pa_hook_result_t sink_unlink_hook_callback(pa_core *c, pa_sink *sink, str
char *name;
struct entry *e;
+ if (!si->sink)
+ continue;
+
if (!(name = get_name(si->proplist, "sink-input")))
continue;
@@ -663,6 +675,12 @@ static pa_hook_result_t source_unlink_hook_callback(pa_core *c, pa_source *sourc
char *name;
struct entry *e;
+ if (so->direct_on_input)
+ continue;
+
+ if (!so->source)
+ continue;
+
if (!(name = get_name(so->proplist, "source-output")))
continue;