diff mbox series

[FFmpeg-devel,23/29] avformat/oma: Move stuff only used by demuxer to demuxer

Message ID 20210218034214.2090223-23-andreas.rheinhardt@gmail.com
State Accepted
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
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavformat/oma.c    | 17 +----------------
 libavformat/oma.h    |  3 ---
 libavformat/omadec.c | 18 ++++++++++++++++--
 3 files changed, 17 insertions(+), 21 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/oma.c b/libavformat/oma.c
index e7bf8553f0..7282d464aa 100644
--- a/libavformat/oma.c
+++ b/libavformat/oma.c
@@ -19,10 +19,9 @@ 
  */
 
 #include <stddef.h>
+#include "libavcodec/codec_id.h"
 #include "internal.h"
 #include "oma.h"
-#include "libavcodec/avcodec.h"
-#include "libavutil/channel_layout.h"
 
 const uint16_t ff_oma_srate_tab[8] = { 320, 441, 480, 882, 960, 0 };
 
@@ -37,17 +36,3 @@  const AVCodecTag ff_oma_codec_tags[] = {
 };
 
 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,
-    AV_CH_LAYOUT_STEREO,
-    AV_CH_LAYOUT_SURROUND,
-    AV_CH_LAYOUT_4POINT0,
-    AV_CH_LAYOUT_5POINT1_BACK,
-    AV_CH_LAYOUT_6POINT1_BACK,
-    AV_CH_LAYOUT_7POINT1
-};
-
-/** map ATRAC-X channel id to total number of channels */
-const int ff_oma_chid_to_num_channels[7] = {1, 2, 3, 4, 6, 7, 8};
diff --git a/libavformat/oma.h b/libavformat/oma.h
index 5df50c8eb4..85d5932f1d 100644
--- a/libavformat/oma.h
+++ b/libavformat/oma.h
@@ -44,7 +44,4 @@  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];
-
 #endif /* AVFORMAT_OMA_H */
diff --git a/libavformat/omadec.c b/libavformat/omadec.c
index 0b36d4e867..0c90f2644d 100644
--- a/libavformat/omadec.c
+++ b/libavformat/omadec.c
@@ -59,6 +59,20 @@  static const uint64_t leaf_table[] = {
     0x1573cd93da7df623, 0x47f98d79620dd535
 };
 
+/** map ATRAC-X channel id to internal channel layout */
+static const uint64_t oma_chid_to_native_layout[7] = {
+    AV_CH_LAYOUT_MONO,
+    AV_CH_LAYOUT_STEREO,
+    AV_CH_LAYOUT_SURROUND,
+    AV_CH_LAYOUT_4POINT0,
+    AV_CH_LAYOUT_5POINT1_BACK,
+    AV_CH_LAYOUT_6POINT1_BACK,
+    AV_CH_LAYOUT_7POINT1
+};
+
+/** map ATRAC-X channel id to total number of channels */
+static const int oma_chid_to_num_channels[7] = {1, 2, 3, 4, 6, 7, 8};
+
 typedef struct OMAContext {
     uint64_t content_start;
     int encrypted;
@@ -492,8 +506,8 @@  static int oma_read_header(AVFormatContext *s)
             ret = AVERROR_INVALIDDATA;
             goto fail;
         }
-        st->codecpar->channel_layout = ff_oma_chid_to_native_layout[channel_id - 1];
-        st->codecpar->channels       = ff_oma_chid_to_num_channels[channel_id - 1];
+        st->codecpar->channel_layout = oma_chid_to_native_layout[channel_id - 1];
+        st->codecpar->channels       = oma_chid_to_num_channels[channel_id - 1];
         framesize = ((codec_params & 0x3FF) * 8) + 8;
         samplerate = ff_oma_srate_tab[(codec_params >> 13) & 7] * 100;
         if (!samplerate) {