[FFmpeg-cvslog] avcodec/adpcmenc: Deduplicate AVClasses

Andreas Rheinhardt git at videolan.org
Thu Jul 22 09:52:32 EEST 2021


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Mon Jun  7 16:13:33 2021 +0200| [62e3d01cc7f2d93df75d2f1a186b6f13c94b1cb4] | committer: Andreas Rheinhardt

avcodec/adpcmenc: Deduplicate AVClasses

The child_class_next API relied on different (de)muxers to use
different AVClasses; yet this API has been replaced by
child_class_iterate.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

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

 libavcodec/adpcmenc.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/libavcodec/adpcmenc.c b/libavcodec/adpcmenc.c
index 244a562d41..ea9f76ab2b 100644
--- a/libavcodec/adpcmenc.c
+++ b/libavcodec/adpcmenc.c
@@ -982,14 +982,14 @@ static const AVOption options[] = {
     { NULL }
 };
 
+static const AVClass adpcm_encoder_class = {
+    .class_name = "ADPCM encoder",
+    .item_name  = av_default_item_name,
+    .option     = options,
+    .version    = LIBAVUTIL_VERSION_INT,
+};
+
 #define ADPCM_ENCODER(id_, name_, sample_fmts_, capabilities_, long_name_) \
-static const AVClass name_ ## _encoder_class = {                           \
-    .class_name = #name_,                                                  \
-    .item_name  = av_default_item_name,                                    \
-    .option     = options,                                                 \
-    .version    = LIBAVUTIL_VERSION_INT,                                   \
-};                                                                         \
-                                                                           \
 const AVCodec ff_ ## name_ ## _encoder = {                                 \
     .name           = #name_,                                              \
     .long_name      = NULL_IF_CONFIG_SMALL(long_name_),                    \
@@ -1002,7 +1002,7 @@ const AVCodec ff_ ## name_ ## _encoder = {                                 \
     .sample_fmts    = sample_fmts_,                                        \
     .capabilities   = capabilities_ | AV_CODEC_CAP_DR1,                    \
     .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, \
-    .priv_class     = &name_ ## _encoder_class,                            \
+    .priv_class     = &adpcm_encoder_class,                                \
 }
 
 ADPCM_ENCODER(AV_CODEC_ID_ADPCM_ARGO,    adpcm_argo,    sample_fmts_p, 0,                             "ADPCM Argonaut Games");



More information about the ffmpeg-cvslog mailing list