aboutsummaryrefslogtreecommitdiffstats
path: root/ponymix.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ponymix.cc')
-rw-r--r--ponymix.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/ponymix.cc b/ponymix.cc
index a07059d..5f1e98c 100644
--- a/ponymix.cc
+++ b/ponymix.cc
@@ -654,13 +654,17 @@ int main(int argc, char* argv[]) {
ServerInfo defaults = ponymix.GetDefaults();
opt_action = "defaults";
opt_devtype = DEVTYPE_SINK;
- opt_device = defaults.sink.c_str();
opt_maxvolume = 100;
if (!parse_options(argc, argv)) return 1;
argc -= optind;
argv += optind;
+ // Do this after parsing such that we respect any changes to opt_devtype and
+ // explicit opt_device
+ if (opt_device == nullptr)
+ opt_device = defaults.GetDefault(opt_devtype).c_str();
+
try {
#ifdef HAVE_NOTIFY
if (opt_notify) {