Rename struct audio format to audio_format_handler
[paraslash.git] / grab_client.c
index f853a76..026211f 100644 (file)
@@ -43,7 +43,7 @@ static int max_num_filters(void)
        for (i = 0; audio_formats[i]; i++) {
                PARA_INFO_LOG("%s filter chain length: %d\n", audio_formats[i],
                        num_filters(i));
-               ret = MAX(ret, num_filters(i));
+               ret = PARA_MAX(ret, num_filters(i));
        }
        PARA_INFO_LOG("maximal filter chain length: %d\n", ret);
        return ret;
@@ -85,6 +85,7 @@ rewrite:
        return ret;
 }
 
+/* TODO: gengetopt can handle the grab client modes */
 static int check_gc_args(struct grab_client *gc)
 {
        int i;
@@ -95,7 +96,10 @@ static int check_gc_args(struct grab_client *gc)
        for (i = 0; mv[i]; i++)
                if (!strcmp(conf->mode_arg, mv[i]))
                        break;
+       if (!mv[i])
+               return -E_GC_SYNTAX;
        gc->mode = i;
+       gc->audio_format_num = -1;
        if (conf->audio_format_given) {
                gc->audio_format_num = get_audio_format_num(conf->audio_format_arg);
                if (gc->audio_format_num < 0)