mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2026-04-08 08:21:11 -04:00
alsa-mixer: add environment variables for profiles and paths
This commit is contained in:
parent
e70d34ae18
commit
6b48dbfcc1
2 changed files with 8 additions and 3 deletions
|
|
@ -2761,12 +2761,13 @@ static int path_verify(pa_alsa_path *p) {
|
|||
}
|
||||
|
||||
static const char *get_default_paths_dir(void) {
|
||||
char *env = getenv("PA_ALSA_PATHS_DIR");
|
||||
#ifdef HAVE_RUNNING_FROM_BUILD_TREE
|
||||
if (pa_run_from_build_tree())
|
||||
return PA_SRCDIR "/modules/alsa/mixer/paths/";
|
||||
else
|
||||
#endif
|
||||
return PA_ALSA_PATHS_DIR;
|
||||
return (env ? env : PA_ALSA_PATHS_DIR);
|
||||
}
|
||||
|
||||
pa_alsa_path* pa_alsa_path_new(const char *paths_dir, const char *fname, pa_alsa_direction_t direction) {
|
||||
|
|
@ -4748,6 +4749,7 @@ pa_alsa_profile_set* pa_alsa_profile_set_new(const char *fname, const pa_channel
|
|||
pa_alsa_profile *p;
|
||||
pa_alsa_mapping *m;
|
||||
pa_alsa_decibel_fix *db_fix;
|
||||
char *env;
|
||||
char *fn;
|
||||
int r;
|
||||
void *state;
|
||||
|
|
@ -4795,11 +4797,13 @@ pa_alsa_profile_set* pa_alsa_profile_set_new(const char *fname, const pa_channel
|
|||
if (!fname)
|
||||
fname = "default.conf";
|
||||
|
||||
env = getenv("PA_ALSA_PROFILE_SETS_DIR");
|
||||
|
||||
fn = pa_maybe_prefix_path(fname,
|
||||
#ifdef HAVE_RUNNING_FROM_BUILD_TREE
|
||||
pa_run_from_build_tree() ? PA_SRCDIR "/modules/alsa/mixer/profile-sets/" :
|
||||
#endif
|
||||
PA_ALSA_PROFILE_SETS_DIR);
|
||||
(env ? env : PA_ALSA_PROFILE_SETS_DIR));
|
||||
|
||||
r = pa_config_parse(fn, NULL, items, NULL, false, ps);
|
||||
pa_xfree(fn);
|
||||
|
|
|
|||
|
|
@ -19,10 +19,11 @@
|
|||
|
||||
/* This function was copied from alsa-mixer.c */
|
||||
static const char *get_default_paths_dir(void) {
|
||||
char *env = getenv("PA_ALSA_PATHS_DIR");
|
||||
if (pa_run_from_build_tree())
|
||||
return PA_SRCDIR "/modules/alsa/mixer/paths/";
|
||||
else
|
||||
return PA_ALSA_PATHS_DIR;
|
||||
return (env ? env : PA_ALSA_PATHS_DIR);
|
||||
}
|
||||
|
||||
static pa_strlist *load_makefile() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue