[FFmpeg-devel] [PATCH 19/29] avformat/caf: Deduplicate codec tags list

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Thu Feb 18 05:42:04 EET 2021


Also saves a relocation.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
---
 libavformat/caf.c    | 1 +
 libavformat/caf.h    | 1 +
 libavformat/cafdec.c | 2 +-
 libavformat/cafenc.c | 2 +-
 4 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavformat/caf.c b/libavformat/caf.c
index fe242ff032..a700e4055b 100644
--- a/libavformat/caf.c
+++ b/libavformat/caf.c
@@ -78,3 +78,4 @@ const AVCodecTag ff_codec_caf_tags[] = {
     { AV_CODEC_ID_NONE,            0 },
 };
 
+const AVCodecTag *const ff_caf_codec_tags_list[] = { ff_codec_caf_tags, NULL };
diff --git a/libavformat/caf.h b/libavformat/caf.h
index 9c25f2c683..ed0392b1f1 100644
--- a/libavformat/caf.h
+++ b/libavformat/caf.h
@@ -30,5 +30,6 @@
 #include "internal.h"
 
 extern const AVCodecTag ff_codec_caf_tags[];
+extern const AVCodecTag *const ff_caf_codec_tags_list[];
 
 #endif /* AVFORMAT_CAF_H */
diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c
index b7a9711cc5..d56187f71f 100644
--- a/libavformat/cafdec.c
+++ b/libavformat/cafdec.c
@@ -460,5 +460,5 @@ AVInputFormat ff_caf_demuxer = {
     .read_header    = read_header,
     .read_packet    = read_packet,
     .read_seek      = read_seek,
-    .codec_tag      = (const AVCodecTag* const []){ ff_codec_caf_tags, 0 },
+    .codec_tag      = ff_caf_codec_tags_list,
 };
diff --git a/libavformat/cafenc.c b/libavformat/cafenc.c
index 98d4d9212f..7e44797a52 100644
--- a/libavformat/cafenc.c
+++ b/libavformat/cafenc.c
@@ -274,5 +274,5 @@ AVOutputFormat ff_caf_muxer = {
     .write_header   = caf_write_header,
     .write_packet   = caf_write_packet,
     .write_trailer  = caf_write_trailer,
-    .codec_tag      = (const AVCodecTag* const []){ff_codec_caf_tags, 0},
+    .codec_tag      = ff_caf_codec_tags_list,
 };
-- 
2.27.0



More information about the ffmpeg-devel mailing list