From 6a9552a4acd7f8c9dfaa8b983349e7399de35a67 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 11 Jan 2021 13:05:11 +0100 Subject: [PATCH] acp; fall back to default when profile-set is not accessible --- spa/plugins/alsa/acp/alsa-mixer.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/spa/plugins/alsa/acp/alsa-mixer.c b/spa/plugins/alsa/acp/alsa-mixer.c index cd41d97f4..217617943 100644 --- a/spa/plugins/alsa/acp/alsa-mixer.c +++ b/spa/plugins/alsa/acp/alsa-mixer.c @@ -4938,12 +4938,13 @@ pa_alsa_profile_set* pa_alsa_profile_set_new(const char *fname, const pa_channel items[0].data = &ps->auto_profiles; - if (!fname) - fname = "default.conf"; - - fn = pa_maybe_prefix_path(fname, + fn = pa_maybe_prefix_path(fname ? fname : "default.conf", get_default_profile_dir()); - + if (access(fn, R_OK) != 0 && fname != NULL) { + pa_log_error("profile-set '%s' can't be accessed, trying default.conf", fn); + fn = pa_maybe_prefix_path("default.conf", + get_default_profile_dir()); + } r = pa_config_parse(fn, NULL, items, NULL, false, ps); pa_xfree(fn);