[FFmpeg-devel] [PATCH 36/41] avcodec/g726: Deduplicate AVClasses

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Thu Jun 17 05:31:57 EEST 2021


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>
---
 libavcodec/g726.c | 23 ++++++++---------------
 1 file changed, 8 insertions(+), 15 deletions(-)

diff --git a/libavcodec/g726.c b/libavcodec/g726.c
index 2e053bc5e3..2a0148c1d5 100644
--- a/libavcodec/g726.c
+++ b/libavcodec/g726.c
@@ -382,13 +382,6 @@ static const AVOption options[] = {
     { NULL },
 };
 
-static const AVCodecDefault defaults[] = {
-    { "b", "0" },
-    { NULL },
-};
-#endif
-
-#if CONFIG_ADPCM_G726_ENCODER
 static const AVClass g726_class = {
     .class_name = "g726",
     .item_name  = av_default_item_name,
@@ -396,6 +389,13 @@ static const AVClass g726_class = {
     .version    = LIBAVUTIL_VERSION_INT,
 };
 
+static const AVCodecDefault defaults[] = {
+    { "b", "0" },
+    { NULL },
+};
+#endif
+
+#if CONFIG_ADPCM_G726_ENCODER
 const AVCodec ff_adpcm_g726_encoder = {
     .name           = "g726",
     .long_name      = NULL_IF_CONFIG_SMALL("G.726 ADPCM"),
@@ -414,13 +414,6 @@ const AVCodec ff_adpcm_g726_encoder = {
 #endif
 
 #if CONFIG_ADPCM_G726LE_ENCODER
-static const AVClass g726le_class = {
-    .class_name = "g726le",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
 const AVCodec ff_adpcm_g726le_encoder = {
     .name           = "g726le",
     .long_name      = NULL_IF_CONFIG_SMALL("G.726 little endian ADPCM (\"right-justified\")"),
@@ -432,7 +425,7 @@ const AVCodec ff_adpcm_g726le_encoder = {
     .encode2        = g726_encode_frame,
     .sample_fmts    = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
                                                      AV_SAMPLE_FMT_NONE },
-    .priv_class     = &g726le_class,
+    .priv_class     = &g726_class,
     .defaults       = defaults,
     .caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE,
 };
-- 
2.27.0



More information about the ffmpeg-devel mailing list