[pulseaudio-discuss] [PATCH] add judgment logic before pa_streq

lishengyu lishengyu at uniontech.com
Thu Jun 30 08:23:26 UTC 2022


---
 src/modules/module-switch-on-port-available.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/modules/module-switch-on-port-available.c b/src/modules/module-switch-on-port-available.c
index de9c87092..53c5a0b32 100644
--- a/src/modules/module-switch-on-port-available.c
+++ b/src/modules/module-switch-on-port-available.c
@@ -393,6 +393,9 @@ static pa_hook_result_t card_profile_available_hook_callback(pa_core *c, pa_card
     if (profile->available != PA_AVAILABLE_NO)
         return PA_HOOK_OK;
 
+    if (!card->active_profile)
+        return PA_HOOK_OK;
+
     if (!pa_streq(profile->name, card->active_profile->name))
         return PA_HOOK_OK;
 
-- 
2.20.1





More information about the pulseaudio-discuss mailing list