diff mbox series

[FFmpeg-devel,16/41] avformat/pcmdec: Deduplicate AVClasses

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

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>
---
 libavformat/pcmdec.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/pcmdec.c b/libavformat/pcmdec.c
index 01447c2b7e..63539a47c0 100644
--- a/libavformat/pcmdec.c
+++ b/libavformat/pcmdec.c
@@ -99,15 +99,15 @@  static const AVOption pcm_options[] = {
     { "channels",    "", offsetof(PCMAudioDemuxerContext, channels),    AV_OPT_TYPE_INT, {.i64 = 1}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
     { NULL },
 };
+static const AVClass pcm_demuxer_class = {
+    .class_name = "pcm demuxer",
+    .item_name  = av_default_item_name,
+    .option     = pcm_options,
+    .version    = LIBAVUTIL_VERSION_INT,
+};
 
 #define PCMDEF_0(name_, long_name_, ext, codec, ...)
 #define PCMDEF_1(name_, long_name_, ext, codec, ...)        \
-static const AVClass name_ ## _demuxer_class = {            \
-    .class_name = #name_ " demuxer",                        \
-    .item_name  = av_default_item_name,                     \
-    .option     = pcm_options,                              \
-    .version    = LIBAVUTIL_VERSION_INT,                    \
-};                                                          \
 const AVInputFormat ff_pcm_ ## name_ ## _demuxer = {        \
     .name           = #name_,                               \
     .long_name      = NULL_IF_CONFIG_SMALL(long_name_),     \
@@ -118,7 +118,7 @@  const AVInputFormat ff_pcm_ ## name_ ## _demuxer = {        \
     .flags          = AVFMT_GENERIC_INDEX,                  \
     .extensions     = ext,                                  \
     .raw_codec_id   = codec,                                \
-    .priv_class     = &name_ ## _demuxer_class,             \
+    .priv_class     = &pcm_demuxer_class,                   \
     __VA_ARGS__                                             \
 };
 #define PCMDEF_2(name, long_name, ext, codec, enabled, ...) \