changeset 31659:a05f97bad2a9

Improve handling of the "help" suboption in coreaudio: Avoid flagging it as an error and continue intialization if it is selected.
author adrian
date Mon, 12 Jul 2010 20:19:09 +0000
parents 66795d9dcb51
children 5fd00f0e4d1c
files libao2/ao_coreaudio.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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;
     }