From 5c7db097ebe1fb5c233cedd8846615074e7d6044 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Tue, 18 Dec 2012 21:47:28 -0500 Subject: avconv: pass libavresample options to AVFilterGraph --- avconv_filter.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'avconv_filter.c') diff --git a/avconv_filter.c b/avconv_filter.c index 50e1e7315a..9cef1afc8a 100644 --- a/avconv_filter.c +++ b/avconv_filter.c @@ -23,8 +23,12 @@ #include "libavfilter/avfilter.h" #include "libavfilter/avfiltergraph.h" +#include "libavresample/avresample.h" + #include "libavutil/avassert.h" +#include "libavutil/avstring.h" #include "libavutil/channel_layout.h" +#include "libavutil/opt.h" #include "libavutil/pixdesc.h" #include "libavutil/pixfmt.h" #include "libavutil/samplefmt.h" @@ -501,9 +505,21 @@ int configure_filtergraph(FilterGraph *fg) if (simple) { OutputStream *ost = fg->outputs[0]->ost; - char args[255]; + char args[512]; + AVDictionaryEntry *e = NULL; + const AVClass *rc = avresample_get_class(); + snprintf(args, sizeof(args), "flags=0x%X", (unsigned)ost->sws_flags); fg->graph->scale_sws_opts = av_strdup(args); + + args[0] = '\0'; + while ((e = av_dict_get(fg->outputs[0]->ost->resample_opts, "", e, + AV_DICT_IGNORE_SUFFIX))) { + av_strlcatf(args, sizeof(args), "%s=%s:", e->key, e->value); + } + if (strlen(args)) + args[strlen(args) - 1] = '\0'; + fg->graph->resample_lavr_opts = av_strdup(args); } if ((ret = avfilter_graph_parse2(fg->graph, graph_desc, &inputs, &outputs)) < 0) -- cgit v1.2.3