summaryrefslogtreecommitdiff
path: root/libavcodec/aacps_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/aacps_common.c
parent97141ffeec803c448d81ee4a53cfa2355f79f7ec (diff)
downloadffmpeg-2d764069be3b4092dc986467660607d922023332.tar.gz
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/aacps_common.c')
-rw-r--r--libavcodec/aacps_common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/aacps_common.c b/libavcodec/aacps_common.c
index 8653b871ca..c388d5b9bc 100644
--- a/libavcodec/aacps_common.c
+++ b/libavcodec/aacps_common.c
@@ -78,7 +78,7 @@ static int read_ ## PAR ## _data(AVCodecContext *avctx, GetBitContext *gb, PSCom
int8_t (*PAR)[PS_MAX_NR_IIDICC], int table_idx, int e, int dt) \
{ \
int b, num = ps->nr_ ## PAR ## _par; \
- VLC_TYPE (*vlc_table)[2] = vlc_ps[table_idx].table; \
+ const VLCElem *vlc_table = vlc_ps[table_idx].table; \
if (dt) { \
int e_prev = e ? e - 1 : ps->num_env_old - 1; \
e_prev = FFMAX(e_prev, 0); \