[PATCH] cork-on-phone: Handle sink-inputs with NULL sinks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/modules/module-cork-music-on-phone.c b/src/modules/module-cork-music-on-phone.c
index b629f06..5e6aa64 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);
 
-- 
1.7.4.1




[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux