[FFmpeg-cvslog] ffmpeg: fix passing swresample options to the auto inserted swr

Michael Niedermayer git at videolan.org
Mon Nov 26 04:32:58 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Nov 23 15:35:48 2012 +0100| [4bd6d73fc8d4bc367668f2770d92a06b0c79146d] | committer: Michael Niedermayer

ffmpeg: fix passing swresample options to the auto inserted swr

Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4bd6d73fc8d4bc367668f2770d92a06b0c79146d
---

 ffmpeg_filter.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/ffmpeg_filter.c b/ffmpeg_filter.c
index 358e1ed..d960f1f 100644
--- a/ffmpeg_filter.c
+++ b/ffmpeg_filter.c
@@ -28,6 +28,7 @@
 #include "libavutil/avstring.h"
 #include "libavutil/bprint.h"
 #include "libavutil/channel_layout.h"
+#include "libavutil/opt.h"
 #include "libavutil/pixdesc.h"
 #include "libavutil/pixfmt.h"
 #include "libavutil/imgutils.h"
@@ -724,6 +725,15 @@ int configure_filtergraph(FilterGraph *fg)
         char args[255];
         snprintf(args, sizeof(args), "flags=0x%X", (unsigned)ost->sws_flags);
         fg->graph->scale_sws_opts = av_strdup(args);
+
+        args[0] = 0;
+        if (ost->swr_dither_method)
+            av_strlcatf(args, sizeof(args), "dither_method=%d:", (int)ost->swr_dither_method);
+        if (ost->swr_dither_scale != 1.0)
+            av_strlcatf(args, sizeof(args), "dither_scale=%f:", ost->swr_dither_scale);
+        if (strlen(args))
+            args[strlen(args)-1] = 0;
+        av_opt_set(fg->graph, "aresample_swr_opts", args, 0);
     }
 
     if ((ret = avfilter_graph_parse2(fg->graph, graph_desc, &inputs, &outputs)) < 0)



More information about the ffmpeg-cvslog mailing list