[FFmpeg-cvslog] ffmpeg: fix swr filter_type for auto inserted aresample filters

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


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Nov 26 04:06:19 2012 +0100| [b5e0e327ceb738c1d329f741e731f77eea8c976a] | committer: Michael Niedermayer

ffmpeg: fix swr filter_type for auto inserted aresample filters

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 ffmpeg.h        |    1 +
 ffmpeg_filter.c |    2 ++
 ffmpeg_opt.c    |    1 +
 3 files changed, 4 insertions(+)

diff --git a/ffmpeg.h b/ffmpeg.h
index e981a74..d260222 100644
--- a/ffmpeg.h
+++ b/ffmpeg.h
@@ -326,6 +326,7 @@ typedef struct OutputStream {
     char *avfilter;
 
     int64_t sws_flags;
+    int64_t swr_filter_type;
     int64_t swr_dither_method;
     double swr_dither_scale;
     AVDictionary *opts;
diff --git a/ffmpeg_filter.c b/ffmpeg_filter.c
index d960f1f..5e37128 100644
--- a/ffmpeg_filter.c
+++ b/ffmpeg_filter.c
@@ -727,6 +727,8 @@ int configure_filtergraph(FilterGraph *fg)
         fg->graph->scale_sws_opts = av_strdup(args);
 
         args[0] = 0;
+        if (ost->swr_filter_type != SWR_FILTER_TYPE_KAISER)
+            av_strlcatf(args, sizeof(args), "filter_type=%d:", (int)ost->swr_filter_type);
         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)
diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index 612bdc6..df85230 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -1015,6 +1015,7 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
         st->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
 
     av_opt_get_int(sws_opts, "sws_flags", 0, &ost->sws_flags);
+    av_opt_get_int   (swr_opts, "filter_type"  , 0, &ost->swr_filter_type);
     av_opt_get_int   (swr_opts, "dither_method", 0, &ost->swr_dither_method);
     av_opt_get_double(swr_opts, "dither_scale" , 0, &ost->swr_dither_scale);
 



More information about the ffmpeg-cvslog mailing list