mirror of
https://github.com/mpv-player/mpv
synced 2025-01-05 03:06:28 +01:00
ao_coreaudio: Improve handling of the "help" suboption
Avoid flagging it as an error and continue intialization if it is selected. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31725 b3059339-0415-0410-9bf9-f77b7e298cf2 Reindent and align after r31725. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31726 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
8362b060d4
commit
ef236e1fe2
@ -400,19 +400,21 @@ OSStatus err;
|
||||
UInt32 size, maxFrames, b_alive;
|
||||
char *psz_name;
|
||||
AudioDeviceID devid_def = 0;
|
||||
int device_id;
|
||||
int device_id, display_help = 0;
|
||||
|
||||
const opt_t subopts[] = {
|
||||
{"device_id", OPT_ARG_INT, &device_id, NULL},
|
||||
{"device_id", OPT_ARG_INT, &device_id, NULL},
|
||||
{"help", OPT_ARG_BOOL, &display_help, NULL},
|
||||
{NULL}
|
||||
};
|
||||
|
||||
// set defaults
|
||||
device_id = 0;
|
||||
|
||||
if (subopt_parse(ao_subdevice, subopts) != 0) {
|
||||
if (subopt_parse(ao_subdevice, subopts) != 0 || display_help) {
|
||||
print_help();
|
||||
return 0;
|
||||
if (!display_help)
|
||||
return 0;
|
||||
}
|
||||
|
||||
ao_msg(MSGT_AO,MSGL_V, "init([%dHz][%dch][%s][%d])\n", rate, channels, af_fmt2str_short(format), flags);
|
||||
|
Loading…
Reference in New Issue
Block a user