From 628137a62820b2659d41affe690cc8a1aedc89c0 Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Mon, 28 Mar 2011 16:39:53 +0530 Subject: cork-on-phone: Handle sink-inputs with NULL sinks 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 | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/modules/module-cork-music-on-phone.c') diff --git a/src/modules/module-cork-music-on-phone.c b/src/modules/module-cork-music-on-phone.c index b629f06f..5e6aa64b 100644 --- a/src/modules/module-cork-music-on-phone.c +++ b/src/modules/module-cork-music-on-phone.c @@ -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); -- cgit