From ef236e1fe22ca4331d42176de5d36e2bdfe22995 Mon Sep 17 00:00:00 2001 From: adrian Date: Mon, 12 Jul 2010 20:19:09 +0000 Subject: 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 --- libao2/ao_coreaudio.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'libao2/ao_coreaudio.c') 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); -- cgit v1.2.3