diff mbox series

[FFmpeg-devel,22/29] avformat/oma: Deduplicate codec tags list

Message ID 20210218034214.2090223-22-andreas.rheinhardt@gmail.com
State Accepted
Commit 81a86c7e1ecf70ae63565ff86699959686753a2d
Headers show
Series [FFmpeg-devel,01/29] configure, libavcodec/Makefile: Remove spurious CAF demuxer dependencies
Related show

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 a relocation.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavformat/oma.c    | 3 +++
 libavformat/oma.h    | 1 +
 libavformat/omadec.c | 2 +-
 libavformat/omaenc.c | 2 +-
 4 files changed, 6 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/oma.c b/libavformat/oma.c
index f7ae3c9948..e7bf8553f0 100644
--- a/libavformat/oma.c
+++ b/libavformat/oma.c
@@ -18,6 +18,7 @@ 
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <stddef.h>
 #include "internal.h"
 #include "oma.h"
 #include "libavcodec/avcodec.h"
@@ -35,6 +36,8 @@  const AVCodecTag ff_oma_codec_tags[] = {
     { 0 },
 };
 
+const AVCodecTag *const ff_oma_codec_tags_list[] = { ff_oma_codec_tags, NULL };
+
 /** map ATRAC-X channel id to internal channel layout */
 const uint64_t ff_oma_chid_to_native_layout[7] = {
     AV_CH_LAYOUT_MONO,
diff --git a/libavformat/oma.h b/libavformat/oma.h
index 36fd0125e4..5df50c8eb4 100644
--- a/libavformat/oma.h
+++ b/libavformat/oma.h
@@ -42,6 +42,7 @@  enum {
 extern const uint16_t ff_oma_srate_tab[8];
 
 extern const AVCodecTag ff_oma_codec_tags[];
+extern const AVCodecTag *const ff_oma_codec_tags_list[];
 
 extern const uint64_t ff_oma_chid_to_native_layout[7];
 extern const int ff_oma_chid_to_num_channels[7];
diff --git a/libavformat/omadec.c b/libavformat/omadec.c
index 5675d86e75..0b36d4e867 100644
--- a/libavformat/omadec.c
+++ b/libavformat/omadec.c
@@ -621,5 +621,5 @@  AVInputFormat ff_oma_demuxer = {
     .read_close     = oma_read_close,
     .flags          = AVFMT_GENERIC_INDEX,
     .extensions     = "oma,omg,aa3",
-    .codec_tag      = (const AVCodecTag* const []){ff_oma_codec_tags, 0},
+    .codec_tag      = ff_oma_codec_tags_list,
 };
diff --git a/libavformat/omaenc.c b/libavformat/omaenc.c
index 7952808bf8..d3c4f62027 100644
--- a/libavformat/omaenc.c
+++ b/libavformat/omaenc.c
@@ -102,6 +102,6 @@  AVOutputFormat ff_oma_muxer = {
     .audio_codec       = AV_CODEC_ID_ATRAC3,
     .write_header      = oma_write_header,
     .write_packet      = ff_raw_write_packet,
-    .codec_tag         = (const AVCodecTag* const []){ff_oma_codec_tags, 0},
+    .codec_tag         = ff_oma_codec_tags_list,
     .flags             = AVFMT_NOTIMESTAMPS,
 };