cork-on-phone: Handle sink-inputs with NULL sinks
authorArun Raghavan <arun.raghavan@collabora.co.uk>
Mon, 28 Mar 2011 11:09:53 +0000 (16:39 +0530)
committerColin Guthrie <colin@mageia.org>
Mon, 28 Mar 2011 12:21:23 +0000 (13:21 +0100)
It's possible that by the time we receive the unlink hook, the given
sink-input's sink is set to NULL. Handle this gracefully.

src/modules/module-cork-music-on-phone.c

index b629f06..5e6aa64 100644 (file)
@@ -138,6 +138,9 @@ static pa_hook_result_t process(struct userdata *u, pa_sink_input *i, pa_bool_t
         !pa_streq(role, "video"))
         return PA_HOOK_OK;
 
+    if (!i->sink)
+        return PA_HOOK_OK;
+
     cork = shall_cork(i->sink, create ? NULL : i);
     apply_cork(u, i->sink, create ? NULL : i, cork);