diff mbox series

[FFmpeg-devel,27/29] avformat/avienc, wtvenc: Deduplicate codec tags list

Message ID 20210218034214.2090223-27-andreas.rheinhardt@gmail.com
State Accepted
Commit 09e6d3a026d25840bf783cc7e6541976b765d1a3
Headers show
Series [FFmpeg-devel,01/29] configure, libavcodec/Makefile: Remove spurious CAF demuxer dependencies | 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 Feb. 18, 2021, 3:42 a.m. UTC
Also saves relocations.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavformat/avienc.c | 4 +---
 libavformat/riff.c   | 7 +++++++
 libavformat/riff.h   | 2 ++
 libavformat/wtvenc.c | 3 +--
 4 files changed, 11 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/avienc.c b/libavformat/avienc.c
index 1b2cb529b9..9cbf3d3349 100644
--- a/libavformat/avienc.c
+++ b/libavformat/avienc.c
@@ -1018,8 +1018,6 @@  AVOutputFormat ff_avi_muxer = {
     .write_header   = avi_write_header,
     .write_packet   = avi_write_packet,
     .write_trailer  = avi_write_trailer,
-    .codec_tag      = (const AVCodecTag * const []) {
-        ff_codec_bmp_tags, ff_codec_wav_tags, 0
-    },
+    .codec_tag      = ff_riff_codec_tags_list,
     .priv_class     = &avi_muxer_class,
 };
diff --git a/libavformat/riff.c b/libavformat/riff.c
index 388047fc4b..eee78c229c 100644
--- a/libavformat/riff.c
+++ b/libavformat/riff.c
@@ -19,6 +19,7 @@ 
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "config.h"
 #include "libavutil/error.h"
 #include "libavcodec/avcodec.h"
 #include "avformat.h"
@@ -589,6 +590,12 @@  const AVCodecTag ff_codec_wav_tags[] = {
     { AV_CODEC_ID_NONE,      0 },
 };
 
+#if CONFIG_AVI_MUXER || CONFIG_WTV_MUXER
+const AVCodecTag *const ff_riff_codec_tags_list[] = {
+    ff_codec_bmp_tags, ff_codec_wav_tags, NULL
+};
+#endif
+
 const AVMetadataConv ff_riff_info_conv[] = {
     { "IART", "artist"     },
     { "ICMT", "comment"    },
diff --git a/libavformat/riff.h b/libavformat/riff.h
index 127138d2bc..47dbaeafd1 100644
--- a/libavformat/riff.h
+++ b/libavformat/riff.h
@@ -72,6 +72,8 @@  int ff_get_wav_header(AVFormatContext *s, AVIOContext *pb, AVCodecParameters *pa
 
 extern const AVCodecTag ff_codec_bmp_tags[]; // exposed through avformat_get_riff_video_tags()
 extern const AVCodecTag ff_codec_wav_tags[];
+/* The following list contains both ff_codec_bmp_tags and ff_codec_wav_tags. */
+extern const AVCodecTag *const ff_riff_codec_tags_list[];
 
 extern const AVCodecTag ff_codec_bmp_tags_unofficial[];
 
diff --git a/libavformat/wtvenc.c b/libavformat/wtvenc.c
index b53fdf9048..24fdbe1099 100644
--- a/libavformat/wtvenc.c
+++ b/libavformat/wtvenc.c
@@ -839,6 +839,5 @@  AVOutputFormat ff_wtv_muxer = {
     .write_header   = write_header,
     .write_packet   = write_packet,
     .write_trailer  = write_trailer,
-    .codec_tag      = (const AVCodecTag* const []){ ff_codec_bmp_tags,
-                                                    ff_codec_wav_tags, 0 },
+    .codec_tag      = ff_riff_codec_tags_list,
 };