Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2022-03-11 12:58:44 +0300
committerAnton Khirnov <anton@khirnov.net>2022-03-22 20:49:43 +0300
commit1728ad829342cb9a1121dd066d335eccdd32e4d6 (patch)
tree015e0818a15bd1c66da4d4bbcbbd76f8ac3b681b /fftools/cmdutils.c
parentbd0cbebf3e495b5f41e8dd307311d6bcc6d7da85 (diff)
fftools/cmdutils: drop redundant code
It allocates a dummy sws/swr context and tries setting options on it, apparently to check if they are valid. This is redundant, since the options will be checked if/when they are later applied on a context that is actually used for conversion.
Diffstat (limited to 'fftools/cmdutils.c')
-rw-r--r--fftools/cmdutils.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index e8047e575c..5d7cdc3e10 100644
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -540,20 +540,12 @@ int opt_default(void *optctx, const char *opt, const char *arg)
#if CONFIG_SWSCALE
if (!consumed && (o = opt_find(&sc, opt, NULL, 0,
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {
- struct SwsContext *sws = sws_alloc_context();
- int ret = av_opt_set(sws, opt, arg, 0);
- sws_freeContext(sws);
if (!strcmp(opt, "srcw") || !strcmp(opt, "srch") ||
!strcmp(opt, "dstw") || !strcmp(opt, "dsth") ||
!strcmp(opt, "src_format") || !strcmp(opt, "dst_format")) {
av_log(NULL, AV_LOG_ERROR, "Directly using swscale dimensions/format options is not supported, please use the -s or -pix_fmt options\n");
return AVERROR(EINVAL);
}
- if (ret < 0) {
- av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", opt);
- return ret;
- }
-
av_dict_set(&sws_dict, opt, arg, FLAGS);
consumed = 1;
@@ -567,13 +559,6 @@ int opt_default(void *optctx, const char *opt, const char *arg)
#if CONFIG_SWRESAMPLE
if (!consumed && (o=opt_find(&swr_class, opt, NULL, 0,
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {
- struct SwrContext *swr = swr_alloc();
- int ret = av_opt_set(swr, opt, arg, 0);
- swr_free(&swr);
- if (ret < 0) {
- av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", opt);
- return ret;
- }
av_dict_set(&swr_opts, opt, arg, FLAGS);
consumed = 1;
}