aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-02-18 02:15:06 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-02-23 11:30:57 +0100
commita442670a3262caf0d2fdc9ccd5697be11d2c2e46 (patch)
treefe12af63b408d549e6ba28dfd2a41cea0fc3970d
parent22d8010f13cb6209d1de591ddc6d4083a0cd646d (diff)
downloadffmpeg-a442670a3262caf0d2fdc9ccd5697be11d2c2e46.tar.gz
avformat/movenc: Deduplicate codec tags lists
Also saves relocations. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-rw-r--r--libavformat/movenc.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index f97383fcfe..545b0885ae 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -7131,6 +7131,7 @@ static int mov_check_bitstream(struct AVFormatContext *s, const AVPacket *pkt)
return ret;
}
+#if CONFIG_TGP_MUXER || CONFIG_TG2_MUXER
static const AVCodecTag codec_3gp_tags[] = {
{ AV_CODEC_ID_H263, MKTAG('s','2','6','3') },
{ AV_CODEC_ID_H264, MKTAG('a','v','c','1') },
@@ -7141,6 +7142,8 @@ static const AVCodecTag codec_3gp_tags[] = {
{ AV_CODEC_ID_MOV_TEXT, MKTAG('t','x','3','g') },
{ AV_CODEC_ID_NONE, 0 },
};
+static const AVCodecTag *const codec_3gp_tags_list[] = { codec_3gp_tags, NULL };
+#endif
static const AVCodecTag codec_mp4_tags[] = {
{ AV_CODEC_ID_MPEG4, MKTAG('m', 'p', '4', 'v') },
@@ -7178,6 +7181,9 @@ static const AVCodecTag codec_mp4_tags[] = {
{ AV_CODEC_ID_MPEGH_3D_AUDIO, MKTAG('m', 'h', 'm', '1') },
{ AV_CODEC_ID_NONE, 0 },
};
+#if CONFIG_MP4_MUXER || CONFIG_PSP_MUXER
+static const AVCodecTag *const mp4_codec_tags_list[] = { codec_mp4_tags, NULL };
+#endif
static const AVCodecTag codec_ism_tags[] = {
{ AV_CODEC_ID_WMAPRO , MKTAG('w', 'm', 'a', ' ') },
@@ -7242,7 +7248,7 @@ AVOutputFormat ff_tgp_muxer = {
.write_trailer = mov_write_trailer,
.deinit = mov_free,
.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
- .codec_tag = (const AVCodecTag* const []){ codec_3gp_tags, 0 },
+ .codec_tag = codec_3gp_tags_list,
.check_bitstream = mov_check_bitstream,
.priv_class = &tgp_muxer_class,
};
@@ -7264,7 +7270,7 @@ AVOutputFormat ff_mp4_muxer = {
.write_trailer = mov_write_trailer,
.deinit = mov_free,
.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
- .codec_tag = (const AVCodecTag* const []){ codec_mp4_tags, 0 },
+ .codec_tag = mp4_codec_tags_list,
.check_bitstream = mov_check_bitstream,
.priv_class = &mp4_muxer_class,
};
@@ -7285,7 +7291,7 @@ AVOutputFormat ff_psp_muxer = {
.write_trailer = mov_write_trailer,
.deinit = mov_free,
.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
- .codec_tag = (const AVCodecTag* const []){ codec_mp4_tags, 0 },
+ .codec_tag = mp4_codec_tags_list,
.check_bitstream = mov_check_bitstream,
.priv_class = &psp_muxer_class,
};
@@ -7305,7 +7311,7 @@ AVOutputFormat ff_tg2_muxer = {
.write_trailer = mov_write_trailer,
.deinit = mov_free,
.flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
- .codec_tag = (const AVCodecTag* const []){ codec_3gp_tags, 0 },
+ .codec_tag = codec_3gp_tags_list,
.check_bitstream = mov_check_bitstream,
.priv_class = &tg2_muxer_class,
};