summaryrefslogtreecommitdiff
path: root/libavcodec/mpegaudiodec_common.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-06-13 23:02:57 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-06-17 16:47:29 +0200
commit2d764069be3b4092dc986467660607d922023332 (patch)
tree1504ef9e286b8df559635e97d31ebe767a9e6426 /libavcodec/mpegaudiodec_common.c
parent97141ffeec803c448d81ee4a53cfa2355f79f7ec (diff)
avcodec/vlc: Use structure instead of VLC_TYPE array as VLC element
In C, qualifiers for arrays are broken: const VLC_TYPE (*foo)[2] is a pointer to an array of two const VLC_TYPE elements and unfortunately this is not compatible with a pointer to a const array of two VLC_TYPE, because the latter does not exist as array types are never qualified (the qualifier applies to the base type instead). This is the reason why get_vlc2() doesn't accept a const VLC table despite not modifying the table at all, as there is no automatic conversion from VLC_TYPE (*)[2] to const VLC_TYPE (*)[2]. Fix this by using a structure VLCElem for the VLC table. This also has the advantage of making it clear which element is which. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/mpegaudiodec_common.c')
-rw-r--r--libavcodec/mpegaudiodec_common.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/mpegaudiodec_common.c b/libavcodec/mpegaudiodec_common.c
index ed2de8adbb..71fc2e7c81 100644
--- a/libavcodec/mpegaudiodec_common.c
+++ b/libavcodec/mpegaudiodec_common.c
@@ -65,10 +65,10 @@ const uint8_t ff_lsf_nsf_table[6][3][4] = {
/* mpegaudio layer 3 huffman tables */
VLC ff_huff_vlc[16];
-static VLC_TYPE huff_vlc_tables[128 + 128 + 128 + 130 + 128 + 154 + 166 + 142 +
- 204 + 190 + 170 + 542 + 460 + 662 + 414][2];
+static VLCElem huff_vlc_tables[128 + 128 + 128 + 130 + 128 + 154 + 166 + 142 +
+ 204 + 190 + 170 + 542 + 460 + 662 + 414];
VLC ff_huff_quad_vlc[2];
-static VLC_TYPE huff_quad_vlc_tables[64 + 16][2];
+static VLCElem huff_quad_vlc_tables[64 + 16];
static const uint8_t mpa_hufflens[] = {
/* Huffman table 1 - 4 entries */