| @@ -2916,6 +2916,19 @@ static int opt_show_mode(const char *opt, const char *arg) · 2915 unmodified lines |
| 2916 | 2916 | return 0; |
| 2917 | 2917 | } |
| 2918 | 2918 | |
| 2919 | +static int opt_input_file(const char *opt, const char *filename) |
| 2920 | +{ |
| 2921 | + if (input_filename) { |
| 2922 | + fprintf(stderr, "Argument '%s' provided as input filename, but '%s' was already specified.\n", |
| 2923 | + filename, input_filename); |
| 2924 | + exit(1); |
| 2925 | + } |
| 2926 | + if (!strcmp(filename, "-")) |
| 2927 | + filename = "pipe:"; |
| 2928 | + input_filename = filename; |
| 2929 | + return 0; |
| 2930 | +} |
| 2931 | + |
| 2919 | 2932 | static const OptionDef options[] = { |
| 2920 | 2933 | #include "cmdutils_common_opts.h" |
| 2921 | 2934 | { "x", HAS_ARG, {(void*)opt_width}, "force displayed width", "width" }, |
| @@ -2961,7 +2974,7 @@ static const OptionDef options[] = { · 39 unmodified lines |
| 2961 | 2974 | { "rdftspeed", OPT_INT | HAS_ARG| OPT_AUDIO | OPT_EXPERT, {(void*)&rdftspeed}, "rdft speed", "msecs" }, |
| 2962 | 2975 | { "showmode", HAS_ARG, {(void*)opt_show_mode}, "select show mode (0 = video, 1 = waves, 2 = RDFT)", "mode" }, |
| 2963 | 2976 | { "default", HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {(void*)opt_default}, "generic catch all option", "" }, |
| 2964 | | − { "i", OPT_DUMMY, {NULL}, "ffmpeg compatibility dummy option", ""}, |
| 2977 | + { "i", HAS_ARG, {(void *)opt_input_file}, "read specified file", "input_file"}, |
| 2965 | 2978 | { NULL, }, |
| 2966 | 2979 | }; |
| 2967 | 2980 | |
| @@ -3006,19 +3019,6 @@ static void show_help(void) · 38 unmodified lines |
| 3006 | 3019 | ); |
| 3007 | 3020 | } |
| 3008 | 3021 | |
| 3009 | | −static int opt_input_file(const char *opt, const char *filename) |
| 3010 | | −{ |
| 3011 | | − if (input_filename) { |
| 3012 | | − fprintf(stderr, "Argument '%s' provided as input filename, but '%s' was already specified.\n", |
| 3013 | | − filename, input_filename); |
| 3014 | | − exit(1); |
| 3015 | | − } |
| 3016 | | − if (!strcmp(filename, "-")) |
| 3017 | | − filename = "pipe:"; |
| 3018 | | − input_filename = filename; |
| 3019 | | − return 0; |
| 3020 | | −} |
| 3021 | | − |
| 3022 | 3022 | /* Called from the main */ |
| 3023 | 3023 | int main(int argc, char **argv) |
| 3024 | 3024 | { |