[FFmpeg-devel] [PATCH] lavfi: deprecate aconvert.

Clément Bœsch ubitux at gmail.com
Thu Apr 11 18:23:27 CEST 2013


This filter is not required anymore with aformat. Drop it at next bump.
---
 doc/examples/filtering_audio.c | 2 +-
 doc/faq.texi                   | 6 +++---
 doc/filters.texi               | 2 ++
 libavfilter/allfilters.c       | 2 ++
 libavfilter/avfilter.c         | 2 ++
 libavfilter/avfiltergraph.h    | 2 +-
 libavfilter/version.h          | 3 +++
 7 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/doc/examples/filtering_audio.c b/doc/examples/filtering_audio.c
index 456a1c9..67588aa 100644
--- a/doc/examples/filtering_audio.c
+++ b/doc/examples/filtering_audio.c
@@ -37,7 +37,7 @@
 #include <libavfilter/buffersink.h>
 #include <libavfilter/buffersrc.h>
 
-const char *filter_descr = "aresample=8000,aconvert=s16:mono";
+const char *filter_descr = "aresample=8000,aformat=sample_fmts=s16:channel_layouts=mono";
 const char *player       = "ffplay -f s16le -ar 8000 -ac 1 -";
 
 static AVFormatContext *fmt_ctx;
diff --git a/doc/faq.texi b/doc/faq.texi
index a95476d..4b0b09c 100644
--- a/doc/faq.texi
+++ b/doc/faq.texi
@@ -393,17 +393,17 @@ Appending @code{:v} to it will do exactly that.
 Use @option{-dumpgraph -} to find out exactly where the channel layout is
 lost.
 
-Most likely, it is through @code{auto-inserted aconvert}. Try to understand
+Most likely, it is through @code{auto-inserted aresample}. Try to understand
 why the converting filter was needed at that place.
 
 Just before the output is a likely place, as @option{-f lavfi} currently
 only support packed S16.
 
-Then insert the correct @code{aconvert} explicitly in the filtergraph,
+Then insert the correct @code{aformat} explicitly in the filtergraph,
 specifying the exact format.
 
 @example
-aconvert=s16:stereo:packed
+aformat=sample_fmts=s16:channel_layouts=stereo
 @end example
 
 @section Why does FFmpeg not see the subtitles in my VOB file?
diff --git a/doc/filters.texi b/doc/filters.texi
index d6b9ca1..6b707de 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -283,6 +283,8 @@ Below is a description of the currently available audio filters.
 
 Convert the input audio format to the specified formats.
 
+ at emph{This filter is deprecated. Use aformat instead.}
+
 The filter accepts a string of the form:
 "@var{sample_format}:@var{channel_layout}".
 
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 721db2e..4c8f2b4 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -45,7 +45,9 @@ void avfilter_register_all(void)
         return;
     initialized = 1;
 
+#if FF_API_ACONVERT_FILTER
     REGISTER_FILTER(ACONVERT,       aconvert,       af);
+#endif
     REGISTER_FILTER(AFADE,          afade,          af);
     REGISTER_FILTER(AFORMAT,        aformat,        af);
     REGISTER_FILTER(ALLPASS,        allpass,        af);
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 334598d..b9251bb 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -673,7 +673,9 @@ static int process_options(AVFilterContext *ctx, AVDictionary **options,
 // TODO: drop me
 static const char *const filters_left_to_update[] = {
     "abuffer",
+#if FF_API_ACONVERT_FILTER
     "aconvert",
+#endif
     "amerge",
     "aresample",
     "atempo",
diff --git a/libavfilter/avfiltergraph.h b/libavfilter/avfiltergraph.h
index 61110f9..2210bfe 100644
--- a/libavfilter/avfiltergraph.h
+++ b/libavfilter/avfiltergraph.h
@@ -98,7 +98,7 @@ int avfilter_graph_create_filter(AVFilterContext **filt_ctx, AVFilter *filt,
  * Enable or disable automatic format conversion inside the graph.
  *
  * Note that format conversion can still happen inside explicitly inserted
- * scale and aconvert filters.
+ * scale and aresample filters.
  *
  * @param flags  any of the AVFILTER_AUTO_CONVERT_* constants
  */
diff --git a/libavfilter/version.h b/libavfilter/version.h
index e98ea38..1ab5480 100644
--- a/libavfilter/version.h
+++ b/libavfilter/version.h
@@ -66,5 +66,8 @@
 #ifndef FF_API_OLD_FILTER_OPTS
 #define FF_API_OLD_FILTER_OPTS              (LIBAVFILTER_VERSION_MAJOR < 4)
 #endif
+#ifndef FF_API_ACONVERT_FILTER
+#define FF_API_ACONVERT_FILTER              (LIBAVFILTER_VERSION_MAJOR < 4)
+#endif
 
 #endif /* AVFILTER_VERSION_H */
-- 
1.8.2.1



More information about the ffmpeg-devel mailing list