mp3: Increase eof timeout
[paraslash.git] / grab_client.c
index cd6cffb8fc50cd25f56b114d5f2acbed5cb7a0eb..2dfb295b8ce87fcb5f165bcfd4b3c25f3bdb5b50 100644 (file)
@@ -23,7 +23,6 @@
  * \sa filter_chain filter_chain_info filter
  */
 
-#include "gcc-compat.h"
 #include "para.h"
 #include "close_on_fork.h"
 #include "grab_client.cmdline.h"
 #include "error.h"
 #include "string.h"
 
-
-/** this maps the enum to the text used at the command line */
-static const char *gc_modes[] = {
-       [GRAB_PEDANTIC] = "pedantic",
-       [GRAB_SLOPPY] = "sloppy",
-       [GRAB_AGGRESSIVE] = "aggressive",
-       NULL
-};
-
 /** grab clients that are not yet attached to a filter node */
 struct list_head inactive_grab_client_list;
 
@@ -100,13 +90,12 @@ static int check_gc_args(struct grab_client *gc)
 {
        int i;
        struct grab_client_args_info *conf = gc->conf;
+       char **mv = grab_client_cmdline_parser_mode_values;
 
        PARA_INFO_LOG("filter_num: %d\n", gc->conf->filter_num_arg);
-       for (i = 0; gc_modes[i]; i++)
-               if (!strcmp(conf->mode_arg, gc_modes[i]))
+       for (i = 0; mv[i]; i++)
+               if (!strcmp(conf->mode_arg, mv[i]))
                        break;
-       if (!gc_modes[i])
-               return -E_INVALID_GRAB_MODE;
        gc->mode = i;
        if (conf->audio_format_given) {
                gc->audio_format_num = get_audio_format_num(conf->audio_format_arg);
@@ -264,6 +253,9 @@ __malloc struct grab_client *grab_client_new(int fd, int argc, char **argv, int
        *err = -E_GC_HELP_GIVEN;
        if (gc->conf->help_given)
                goto err_out;
+       *err = -E_GC_VERSION_GIVEN;
+       if (gc->conf->version_given)
+               goto err_out;
        *err = check_gc_args(gc);
        if (*err < 0)
                goto err_out;