[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] card: Only fire the profile available changed hook for linked cards

Tanu Kaskinen gitlab at gitlab.freedesktop.org
Wed Jan 23 15:29:34 UTC 2019


Tanu Kaskinen pushed to branch master at PulseAudio / pulseaudio


Commits:
334ae350 by João Paulo Rechi Vita at 2019-01-23T15:18:22Z
card: Only fire the profile available changed hook for linked cards

pa_card_profile_set_available needs to check if the card is linked
before firing PA_CORE_HOOK_CARD_PROFILE_AVAILABLE_CHANGED, so callbacks
connected to it receive a fully initialized card object.

This fixes a crash introduced by commit 30a551bbc
"switch-on-port-available: Check if we need to change the active
profile".

- - - - -


1 changed file:

- src/pulsecore/card.c


Changes:

=====================================
src/pulsecore/card.c
=====================================
@@ -89,7 +89,8 @@ void pa_card_profile_set_available(pa_card_profile *c, pa_available_t available)
     pa_assert_se(core = c->card->core);
     pa_subscription_post(core, PA_SUBSCRIPTION_EVENT_CARD|PA_SUBSCRIPTION_EVENT_CHANGE, c->card->index);
 
-    pa_hook_fire(&core->hooks[PA_CORE_HOOK_CARD_PROFILE_AVAILABLE_CHANGED], c);
+    if (c->card->linked)
+        pa_hook_fire(&core->hooks[PA_CORE_HOOK_CARD_PROFILE_AVAILABLE_CHANGED], c);
 }
 
 pa_card_new_data* pa_card_new_data_init(pa_card_new_data *data) {



View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/commit/334ae350b4cdd8af2d6d3b4034f58fa0b3ad7f53

-- 
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/commit/334ae350b4cdd8af2d6d3b4034f58fa0b3ad7f53
You're receiving this email because of your account on gitlab.freedesktop.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20190123/b2b9d427/attachment.html>


More information about the pulseaudio-commits mailing list