mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-21 21:40:20 +00:00
parse_options: ensure audio device given once
avoid unintended audio playback/capture devices given refer GH-316
This commit is contained in:
@@ -809,6 +809,10 @@ static int parse_options(int argc, char *argv[], struct ug_options *opt) {
|
||||
audio_playback_help(strcmp(optarg, "full") == 0);
|
||||
return 1;
|
||||
}
|
||||
if (string(opt->audio.recv_cfg) != ug_options().audio.recv_cfg) {
|
||||
log_msg(LOG_LEVEL_ERROR, "Multiple audio playback devices given!\n");
|
||||
return -EXIT_FAIL_USAGE;
|
||||
}
|
||||
opt->audio.recv_cfg = optarg;
|
||||
break;
|
||||
case 's':
|
||||
@@ -816,6 +820,10 @@ static int parse_options(int argc, char *argv[], struct ug_options *opt) {
|
||||
audio_capture_print_help(strcmp(optarg, "full") == 0);
|
||||
return 1;
|
||||
}
|
||||
if (string(opt->audio.send_cfg) != ug_options().audio.send_cfg) {
|
||||
log_msg(LOG_LEVEL_ERROR, "Multiple audio capturers given!\n");
|
||||
return -EXIT_FAIL_USAGE;
|
||||
}
|
||||
opt->audio.send_cfg = optarg;
|
||||
break;
|
||||
case 'f':
|
||||
|
||||
Reference in New Issue
Block a user