The AVOptions based default to threads auto in 2473a45c8 works only if avplay does not use custom option handling for -threads.
Unified · Split
| @@ -242,7 +242,6 @@ static int64_t duration = AV_NOPTS_VALUE; · 241 unmodified lines | |||
| 242 | static int debug = 0; | 242 | static int debug = 0; |
| 243 | static int debug_mv = 0; | 243 | static int debug_mv = 0; |
| 244 | static int step = 0; | 244 | static int step = 0; |
| 245 | static int thread_count = 1; | ||
| 246 | static int workaround_bugs = 1; | 245 | static int workaround_bugs = 1; |
| 247 | static int fast = 0; | 246 | static int fast = 0; |
| 248 | static int genpts = 0; | 247 | static int genpts = 0; |
| @@ -2189,7 +2188,6 @@ static int stream_component_open(VideoState *is, int stream_index) · 1940 unmodified lines | |||
| 2189 | avctx->skip_idct = skip_idct; | 2188 | avctx->skip_idct = skip_idct; |
| 2190 | avctx->skip_loop_filter = skip_loop_filter; | 2189 | avctx->skip_loop_filter = skip_loop_filter; |
| 2191 | avctx->error_concealment = error_concealment; | 2190 | avctx->error_concealment = error_concealment; |
| 2192 | avctx->thread_count = thread_count; | ||
| 2193 | 2191 | ||
| 2194 | if (lowres) avctx->flags |= CODEC_FLAG_EMU_EDGE; | 2192 | if (lowres) avctx->flags |= CODEC_FLAG_EMU_EDGE; |
| 2195 | if (fast) avctx->flags2 |= CODEC_FLAG2_FAST; | 2193 | if (fast) avctx->flags2 |= CODEC_FLAG2_FAST; |
| @@ -2954,15 +2952,6 @@ static int opt_vismv(const char *opt, const char *arg) · 758 unmodified lines | |||
| 2954 | return 0; | 2952 | return 0; |
| 2955 | } | 2953 | } |
| 2956 | 2954 | ||
| 2957 | static int opt_thread_count(const char *opt, const char *arg) | ||
| 2958 | { | ||
| 2959 | thread_count = parse_number_or_die(opt, arg, OPT_INT64, 0, INT_MAX); | ||
| 2960 | #if !HAVE_THREADS | ||
| 2961 | fprintf(stderr, "Warning: not compiled with thread support, using thread emulation\n"); | ||
| 2962 | #endif | ||
| 2963 | return 0; | ||
| 2964 | } | ||
| 2965 | |||
| 2966 | static const OptionDef options[] = { | 2955 | static const OptionDef options[] = { |
| 2967 | #include "cmdutils_common_opts.h" | 2956 | #include "cmdutils_common_opts.h" |
| 2968 | { "x", HAS_ARG, { (void*)opt_width }, "force displayed width", "width" }, | 2957 | { "x", HAS_ARG, { (void*)opt_width }, "force displayed width", "width" }, |
| @@ -2994,7 +2983,6 @@ static const OptionDef options[] = { · 25 unmodified lines | |||
| 2994 | { "idct", OPT_INT | HAS_ARG | OPT_EXPERT, { (void*)&idct }, "set idct algo", "algo" }, | 2983 | { "idct", OPT_INT | HAS_ARG | OPT_EXPERT, { (void*)&idct }, "set idct algo", "algo" }, |
| 2995 | { "ec", OPT_INT | HAS_ARG | OPT_EXPERT, { (void*)&error_concealment }, "set error concealment options", "bit_mask" }, | 2984 | { "ec", OPT_INT | HAS_ARG | OPT_EXPERT, { (void*)&error_concealment }, "set error concealment options", "bit_mask" }, |
| 2996 | { "sync", HAS_ARG | OPT_EXPERT, { (void*)opt_sync }, "set audio-video sync. type (type=audio/video/ext)", "type" }, | 2985 | { "sync", HAS_ARG | OPT_EXPERT, { (void*)opt_sync }, "set audio-video sync. type (type=audio/video/ext)", "type" }, |
| 2997 | { "threads", HAS_ARG | OPT_EXPERT, { (void*)opt_thread_count }, "thread count", "count" }, | ||
| 2998 | { "autoexit", OPT_BOOL | OPT_EXPERT, { (void*)&autoexit }, "exit at the end", "" }, | 2986 | { "autoexit", OPT_BOOL | OPT_EXPERT, { (void*)&autoexit }, "exit at the end", "" }, |
| 2999 | { "exitonkeydown", OPT_BOOL | OPT_EXPERT, { (void*)&exit_on_keydown }, "exit on key down", "" }, | 2987 | { "exitonkeydown", OPT_BOOL | OPT_EXPERT, { (void*)&exit_on_keydown }, "exit on key down", "" }, |
| 3000 | { "exitonmousedown", OPT_BOOL | OPT_EXPERT, { (void*)&exit_on_mousedown }, "exit on mouse down", "" }, | 2988 | { "exitonmousedown", OPT_BOOL | OPT_EXPERT, { (void*)&exit_on_mousedown }, "exit on mouse down", "" }, |