]> git.sesse.net Git - ffmpeg/commitdiff
avformat/avienc, wtvenc: Deduplicate codec tags list
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Thu, 18 Feb 2021 02:26:57 +0000 (03:26 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 23 Feb 2021 10:30:57 +0000 (11:30 +0100)
Also saves relocations.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavformat/avienc.c
libavformat/riff.c
libavformat/riff.h
libavformat/wtvenc.c

index 1b2cb529b90b4a0cc32d4175ba59426891acc520..9cbf3d33493ed0ee7b2e2ca9d8ca7eb30ae6e2f8 100644 (file)
@@ -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,
 };
index 388047fc4b31247c941f0a21a9c4f2a3d3048d2d..eee78c229cdcf8db1e7b97893ccba2d81570d8b1 100644 (file)
@@ -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"    },
index 127138d2bcabf2ccd6a2b36a18babe19e4b2cf72..47dbaeafd171e954a054ab02f4f417533e693fdc 100644 (file)
@@ -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[];
 
index b53fdf904878fe1a52f8fe2532ab428d1d8ea27f..24fdbe109913a3dbf6fcd5acc4ebf6626c9e15f8 100644 (file)
@@ -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,
 };