summaryrefslogtreecommitdiffstats
path: root/libao2
diff options
context:
space:
mode:
authoradrian <adrian@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-07-12 20:19:09 +0000
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-02 04:14:44 +0200
commitef236e1fe22ca4331d42176de5d36e2bdfe22995 (patch)
treef695ef919392d280a14358ec14999a9c4bd8c803 /libao2
parent8362b060d46f038a1eb5bb810f4ab4818b1ea754 (diff)
downloadmpv-ef236e1fe22ca4331d42176de5d36e2bdfe22995.tar.bz2
mpv-ef236e1fe22ca4331d42176de5d36e2bdfe22995.tar.xz
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
Diffstat (limited to 'libao2')
-rw-r--r--libao2/ao_coreaudio.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libao2/ao_coreaudio.c b/libao2/ao_coreaudio.c
index bc8d420877..8a8387bed6 100644
--- a/libao2/ao_coreaudio.c
+++ b/libao2/ao_coreaudio.c
@@ -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);