diff options
author | Tanu Kaskinen <tanuk@iki.fi> | 2015-10-23 12:59:53 +0300 |
---|---|---|
committer | Tanu Kaskinen <tanuk@iki.fi> | 2016-06-28 16:55:42 +0300 |
commit | 7b62601401495684b1ea0b6dce63d76e10da38e4 (patch) | |
tree | b00d53b34b4b377635d370dc67a27caa814db6f7 /src/pulsecore/core.h | |
parent | 18d44b97594233f97d26daf1aaf5e7c953ed3843 (diff) | |
download | pulseaudio-7b62601401495684b1ea0b6dce63d76e10da38e4.tar.gz |
card: move profile selection after pa_card_new()
I want module-alsa-card to set the availability of unavailable
profiles before the initial card profile gets selected, so that the
selection logic can use correct availability information.
module-alsa-card initializes the jack state after calling
pa_card_new(), however, and the profile selection happens in
pa_card_new(). This patch solves that by moving parts of pa_card_new()
to pa_card_choose_initial_profile() and pa_card_put().
pa_card_choose_initial_profile() applies the profile selection policy,
so module-alsa-card can first call pa_card_new(), then initialize the
jack state, and then call pa_card_choose_initial_profile(). After that
module-alsa-card can still override the profile selection policy, in
case module-alsa-card was loaded with the "profile" argument. Finally,
pa_card_put() finalizes the card creation.
An alternative solution would have been to move the jack
initialization to happen before pa_card_new() and use pa_card_new_data
instead of pa_card in the jack initialization code, but I disliked
that idea (I want to get rid of the "new data" pattern eventually).
The order in which the initial profile policy is applied is reversed
in this patch. Previously the first one to set it won, now the last
one to set it wins. I think this is better, because if you have N
parties that want to set the profile, we avoid checking N times
whether someone else has already set the profile.
Diffstat (limited to 'src/pulsecore/core.h')
-rw-r--r-- | src/pulsecore/core.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/pulsecore/core.h b/src/pulsecore/core.h index 00d7f2f2d..802111ba1 100644 --- a/src/pulsecore/core.h +++ b/src/pulsecore/core.h @@ -118,6 +118,7 @@ typedef enum pa_core_hook { PA_CORE_HOOK_CLIENT_PROPLIST_CHANGED, PA_CORE_HOOK_CLIENT_SEND_EVENT, PA_CORE_HOOK_CARD_NEW, + PA_CORE_HOOK_CARD_CHOOSE_INITIAL_PROFILE, PA_CORE_HOOK_CARD_PUT, PA_CORE_HOOK_CARD_UNLINK, PA_CORE_HOOK_CARD_PREFERRED_PORT_CHANGED, |