From b5049814838c63915e42fb4789d88ccc11446e2f Mon Sep 17 00:00:00 2001 From: Baptiste Coudurier Date: Sat, 3 Jul 2010 03:12:29 +0000 Subject: Use default graph swscale opts when no opts are supplied Originally committed as revision 24016 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavfilter/graphparser.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libavfilter') diff --git a/libavfilter/graphparser.c b/libavfilter/graphparser.c index 3fe8524ad3..46d7676093 100644 --- a/libavfilter/graphparser.c +++ b/libavfilter/graphparser.c @@ -81,6 +81,7 @@ static AVFilterContext *create_filter(AVFilterGraph *ctx, int index, AVFilter *filt; char inst_name[30]; + char tmp_args[256]; snprintf(inst_name, sizeof(inst_name), "Filter %d %s", index, filt_name); @@ -104,6 +105,12 @@ static AVFilterContext *create_filter(AVFilterGraph *ctx, int index, return NULL; } + if (!strcmp(filt_name, "scale") && !strstr(args, "flags")) { + snprintf(tmp_args, sizeof(tmp_args), "%s:%s", + args, ctx->scale_sws_opts); + args = tmp_args; + } + if(avfilter_init_filter(filt_ctx, args, NULL)) { av_log(log_ctx, AV_LOG_ERROR, "error initializing filter '%s' with args '%s'\n", filt_name, args); -- cgit v1.2.3