summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorTanu Kaskinen <tanuk@iki.fi>2017-11-08 14:20:23 +0200
committerTanu Kaskinen <tanuk@iki.fi>2017-11-21 15:15:34 +0200
commitd65974d8501052bafb03e65f5df954511e9949a2 (patch)
treeabf40a6ef555fff98067363cb0cc07d42901046c /src/modules
parent33e31b5b70be30a9b59de155aec59807d5f93bc7 (diff)
downloadpulseaudio-d65974d8501052bafb03e65f5df954511e9949a2.tar.gz
card-restore: don't restore unavailable profiles
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/module-card-restore.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/modules/module-card-restore.c b/src/modules/module-card-restore.c
index 2d3a91c01..b7189ad53 100644
--- a/src/modules/module-card-restore.c
+++ b/src/modules/module-card-restore.c
@@ -561,8 +561,12 @@ static pa_hook_result_t card_choose_initial_profile_callback(pa_core *core, pa_c
profile = pa_hashmap_get(card->profiles, e->profile);
if (profile) {
- pa_log_info("Restoring profile '%s' for card %s.", profile->name, card->name);
- pa_card_set_profile(card, profile, true);
+ if (profile->available != PA_AVAILABLE_NO) {
+ pa_log_info("Restoring profile '%s' for card %s.", profile->name, card->name);
+ pa_card_set_profile(card, profile, true);
+ } else
+ pa_log_debug("Not restoring profile %s for card %s, because the profile is currently unavailable.",
+ profile->name, card->name);
} else {
pa_log_debug("Tried to restore profile %s for card %s, but the card doesn't have such profile.",
e->profile, card->name);