# HG changeset patch # User adrian # Date 1278965949 0 # Node ID a05f97bad2a9bc77d2a736caff521d14b0454946 # Parent 66795d9dcb5160ab26fb4855e59932903033a6d7 Improve handling of the "help" suboption in coreaudio: Avoid flagging it as an error and continue intialization if it is selected. diff -r 66795d9dcb51 -r a05f97bad2a9 libao2/ao_coreaudio.c --- a/libao2/ao_coreaudio.c Mon Jul 12 18:04:05 2010 +0000 +++ b/libao2/ao_coreaudio.c Mon Jul 12 20:19:09 2010 +0000 @@ -400,18 +400,20 @@ 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}, + {"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(); + if (!display_help) return 0; }