diff mbox series

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

Message ID VI1PR0301MB21597E75E8CB965434A5D17D8F0E9@VI1PR0301MB2159.eurprd03.prod.outlook.com
State Accepted
Commit 01f4f6c2977cc94795761b434b11dde60e52f71b
Headers show
Series [FFmpeg-devel,01/41] avformat/Makefile: Add missing rawdec dependency for IPU demuxer
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt June 17, 2021, 2:31 a.m. UTC
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@outlook.com>
---
 libavcodec/g726.c | 23 ++++++++---------------
 1 file changed, 8 insertions(+), 15 deletions(-)
diff mbox series

Patch

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,
 };