summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorJuha Heinanen <jh@tutpro.com>2016-06-07 21:24:40 +0300
committerJuha Heinanen <jh@tutpro.com>2016-06-07 21:24:40 +0300
commit44bca9a3fcb5d500f4f1c8ae922423b40140c1fe (patch)
tree91f08362b9637dda1f51279499825a7c713b2cb0 /src/main.c
parent291332d58c3bc67eb3f937704e1005aeee673d7e (diff)
config: added 'audio_path' config variable
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 418fdc8..85e768b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -70,6 +70,7 @@ int main(int argc, char *argv[])
bool prefer_ipv6 = false, run_daemon = false, test = false;
const char *ua_eprm = NULL;
const char *exec = NULL;
+ const char *audio_path = NULL;
const char *modv[16];
size_t modc = 0;
int err;
@@ -127,7 +128,7 @@ int main(int argc, char *argv[])
break;
case 'p':
- play_set_path(optarg);
+ audio_path = optarg;
break;
case 't':
@@ -157,6 +158,12 @@ int main(int argc, char *argv[])
goto out;
}
+ /* Set audio path preferring the one given in -p argument (if any) */
+ if (audio_path)
+ play_set_path(audio_path);
+ else if (str_isset(conf_config()->audio.audio_path))
+ play_set_path(conf_config()->audio.audio_path);
+
/*
* Initialise the top-level baresip struct, must be
* done AFTER configuration is complete.