X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=cmdutils.c;h=69a11bdd4fb33ccdc1420e15edb7c47c8ce84098;hb=b5aa48551300eed678aaea86ced7086758598a35;hp=8e437951915c2fb7f997aedbec3565212101f194;hpb=636ced8e1dc8248a1353b416240b93d70ad03edb;p=ffmpeg diff --git a/cmdutils.c b/cmdutils.c index 8e437951915..69a11bdd4fb 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -20,6 +20,7 @@ */ #include +#include #include #include #include @@ -43,6 +44,7 @@ #include "libavutil/eval.h" #include "libavutil/dict.h" #include "libavutil/opt.h" +#include "libavutil/cpu.h" #include "cmdutils.h" #include "version.h" #if CONFIG_NETWORK @@ -56,7 +58,7 @@ struct SwsContext *sws_opts; AVDictionary *format_opts, *codec_opts, *resample_opts; -static const int this_year = 2013; +static const int this_year = 2014; void init_opts(void) { @@ -182,7 +184,10 @@ static const OptionDef *find_option(const OptionDef *po, const char *name) return po; } -#if HAVE_COMMANDLINETOARGVW +/* _WIN32 means using the windows libc - cygwin doesn't define that + * by default. HAVE_COMMANDLINETOARGVW is true on cygwin, while + * it doesn't provide the actual command line via GetCommandLineW(). */ +#if HAVE_COMMANDLINETOARGVW && defined(_WIN32) #include #include /* Will be leaked on exit */ @@ -691,6 +696,17 @@ do { \ return 0; } +int opt_cpuflags(void *optctx, const char *opt, const char *arg) +{ + int flags = av_parse_cpu_flags(arg); + + if (flags < 0) + return flags; + + av_set_cpu_flags_mask(flags); + return 0; +} + int opt_loglevel(void *optctx, const char *opt, const char *arg) { const struct { const char *name; int level; } log_levels[] = { @@ -1514,6 +1530,12 @@ int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec) return 1; } return 0; + } else if (*spec == 'i' && *(spec + 1) == ':') { + int stream_id; + char *endptr; + spec += 2; + stream_id = strtol(spec, &endptr, 0); + return stream_id == st->id; } else if (!*spec) /* empty specifier, matches everything */ return 1;