X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=libavfilter%2Favfiltergraph.c;h=4cc68924043176354473bd0862aa50169b94eeb5;hb=4bb04098204afadc8604af0113294f8ecc63a2de;hp=a009e0a760e11f95487967a046842f820f6cb963;hpb=4e754e94195b21b49f37471d29841cff2562e320;p=ffmpeg diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c index a009e0a760e..4cc68924043 100644 --- a/libavfilter/avfiltergraph.c +++ b/libavfilter/avfiltergraph.c @@ -43,17 +43,19 @@ #include "thread.h" #define OFFSET(x) offsetof(AVFilterGraph, x) -#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM +#define F AV_OPT_FLAG_FILTERING_PARAM +#define V AV_OPT_FLAG_VIDEO_PARAM +#define A AV_OPT_FLAG_AUDIO_PARAM static const AVOption filtergraph_options[] = { { "thread_type", "Allowed thread types", OFFSET(thread_type), AV_OPT_TYPE_FLAGS, - { .i64 = AVFILTER_THREAD_SLICE }, 0, INT_MAX, FLAGS, "thread_type" }, - { "slice", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AVFILTER_THREAD_SLICE }, .flags = FLAGS, .unit = "thread_type" }, + { .i64 = AVFILTER_THREAD_SLICE }, 0, INT_MAX, F|V|A, "thread_type" }, + { "slice", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AVFILTER_THREAD_SLICE }, .flags = F|V|A, .unit = "thread_type" }, { "threads", "Maximum number of threads", OFFSET(nb_threads), - AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, FLAGS }, + AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, F|V|A }, {"scale_sws_opts" , "default scale filter options" , OFFSET(scale_sws_opts) , - AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS }, + AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, F|V }, {"aresample_swr_opts" , "default aresample filter options" , OFFSET(aresample_swr_opts) , - AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS }, + AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, F|A }, { NULL }, }; @@ -516,7 +518,6 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx) AVFilterContext *convert; const AVFilter *filter; AVFilterLink *inlink, *outlink; - char scale_args[256]; char inst_name[30]; if (graph->disable_auto_convert) { @@ -553,10 +554,6 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx) snprintf(inst_name, sizeof(inst_name), "auto_resampler_%d", resampler_count++); - scale_args[0] = '\0'; - if (graph->aresample_swr_opts) - snprintf(scale_args, sizeof(scale_args), "%s", - graph->aresample_swr_opts); if ((ret = avfilter_graph_create_filter(&convert, filter, inst_name, graph->aresample_swr_opts, NULL, graph)) < 0)