# HG changeset patch # User reimar # Date 1337361395 0 # Node ID 77fa83061e2af107351b15d5cc3697332fe1af31 # Parent becaa4804918d18258827eff01d014b77d7b32f9 Make some tables const. diff -r becaa4804918 -r 77fa83061e2a libmpdemux/mp3_hdr.c --- a/libmpdemux/mp3_hdr.c Fri May 18 17:14:04 2012 +0000 +++ b/libmpdemux/mp3_hdr.c Fri May 18 17:16:35 2012 +0000 @@ -17,6 +17,7 @@ */ #include +#include #include "config.h" #include "mp_msg.h" @@ -24,7 +25,7 @@ //----------------------- mp3 audio frame header parser ----------------------- -static int tabsel_123[2][3][16] = { +static const uint16_t tabsel_123[2][3][16] = { { {0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,0}, {0,32,48,56, 64, 80, 96,112,128,160,192,224,256,320,384,0}, {0,32,40,48, 56, 64, 80, 96,112,128,160,192,224,256,320,0} }, @@ -34,7 +35,7 @@ {0,8,16,24,32,40,48,56,64,80,96,112,128,144,160,0} } }; -static long freqs[9] = { 44100, 48000, 32000, // MPEG 1.0 +static const int freqs[9] = { 44100, 48000, 32000, // MPEG 1.0 22050, 24000, 16000, // MPEG 2.0 11025, 12000, 8000}; // MPEG 2.5 @@ -44,7 +45,8 @@ int mp_get_mp3_header(unsigned char* hbuf,int* chans, int* srate, int* spf, int* mpa_layer, int* br){ int stereo,ssize,lsf,framesize,padding,bitrate_index,sampling_frequency, divisor; int bitrate; - int layer, mult[3] = { 12000, 144000, 144000 }; + int layer; + static const int mult[3] = { 12000, 144000, 144000 }; unsigned long newhead = hbuf[0] << 24 | hbuf[1] << 16 |