mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-07 13:30:03 -05:00
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".
This commit is contained in:
parent
a5f25af043
commit
334ae350b4
1 changed files with 2 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue