summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2015-11-11 17:38:43 +0100
committerDiego Biurrun <diego@biurrun.de>2016-05-05 10:48:34 +0200
commit5afb94c817abffad030c6b94d7003dca8aace3d5 (patch)
tree517222058bab9a1b2ba41abd4a38280388dbf57a /libavformat
parent1f1ad8ace040a08edc2646ff638ca42a8828779f (diff)
Mark read-only tables as static
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/hls.c3
-rw-r--r--libavformat/matroskadec.c2
-rw-r--r--libavformat/movenc.c8
-rw-r--r--libavformat/mp3dec.c2
-rw-r--r--libavformat/rdt.c2
-rw-r--r--libavformat/smoothstreamingenc.c2
-rw-r--r--libavformat/spdifenc.c6
7 files changed, 13 insertions, 12 deletions
diff --git a/libavformat/hls.c b/libavformat/hls.c
index 8459f12269..3b8e28038d 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -477,7 +477,8 @@ reload:
static int save_avio_options(AVFormatContext *s)
{
HLSContext *c = s->priv_data;
- const char *opts[] = { "headers", "user_agent", NULL }, **opt = opts;
+ static const char *opts[] = { "headers", "user_agent", NULL };
+ const char **opt = opts;
uint8_t *buf;
int ret = 0;
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 978d56db16..ceac4babef 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1809,7 +1809,7 @@ static int matroska_parse_tracks(AVFormatContext *s)
track->codec_priv.size = 0;
} else {
if (codec_id == AV_CODEC_ID_SIPR && flavor < 4) {
- const int sipr_bit_rate[4] = { 6504, 8496, 5000, 16000 };
+ static const int sipr_bit_rate[4] = { 6504, 8496, 5000, 16000 };
track->audio.sub_packet_size = ff_sipr_subpk_size[flavor];
st->codecpar->bit_rate = sipr_bit_rate[flavor];
}
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index f7bbb2f8ed..202c72023c 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -2345,7 +2345,7 @@ static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov)
{
int64_t pos = avio_tell(pb);
int i;
- const uint8_t uuid[] = {
+ static const uint8_t uuid[] = {
0xa5, 0xd4, 0x0b, 0x30, 0xe8, 0x14, 0x11, 0xdd,
0xba, 0x2f, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66
};
@@ -2558,7 +2558,7 @@ static int mov_write_trun_tag(AVIOContext *pb, MOVMuxContext *mov,
static int mov_write_tfxd_tag(AVIOContext *pb, MOVTrack *track)
{
int64_t pos = avio_tell(pb);
- const uint8_t uuid[] = {
+ static const uint8_t uuid[] = {
0x6d, 0x1d, 0x9b, 0x05, 0x42, 0xd5, 0x44, 0xe6,
0x80, 0xe2, 0x14, 0x1d, 0xaf, 0xf7, 0x57, 0xb2
};
@@ -2581,7 +2581,7 @@ static int mov_write_tfrf_tag(AVIOContext *pb, MOVMuxContext *mov,
{
int n = track->nb_frag_info - 1 - entry, i;
int size = 8 + 16 + 4 + 1 + 16*n;
- const uint8_t uuid[] = {
+ static const uint8_t uuid[] = {
0xd4, 0x80, 0x7e, 0xf2, 0xca, 0x39, 0x46, 0x95,
0x8e, 0x54, 0x26, 0xcb, 0x9e, 0x46, 0xa7, 0x9f
};
@@ -3677,7 +3677,7 @@ static int mov_create_chapter_track(AVFormatContext *s, int tracknum)
pkt.duration = end - pkt.dts;
if ((t = av_dict_get(c->metadata, "title", NULL, 0))) {
- const char encd[12] = {
+ static const char encd[12] = {
0x00, 0x00, 0x00, 0x0C,
'e', 'n', 'c', 'd',
0x00, 0x00, 0x01, 0x00 };
diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c
index 89fb376a06..0838962e76 100644
--- a/libavformat/mp3dec.c
+++ b/libavformat/mp3dec.c
@@ -151,7 +151,7 @@ static void mp3_parse_info_tag(AVFormatContext *s, AVStream *st,
int32_t r_gain = INT32_MIN, a_gain = INT32_MIN;
MP3DecContext *mp3 = s->priv_data;
- const int64_t xing_offtbl[2][2] = {{32, 17}, {17,9}};
+ static const int64_t xing_offtbl[2][2] = { { 32, 17 }, { 17, 9 } };
/* Check for Xing / Info tag */
avio_skip(s->pb, xing_offtbl[c->lsf == 1][c->nb_channels == 1]);
diff --git a/libavformat/rdt.c b/libavformat/rdt.c
index a759c7e9a2..eb718cfe81 100644
--- a/libavformat/rdt.c
+++ b/libavformat/rdt.c
@@ -98,7 +98,7 @@ ff_rdt_calc_response_and_checksum(char response[41], char chksum[9],
unsigned char zres[16],
buf[64] = { 0xa1, 0xe9, 0x14, 0x9d, 0x0e, 0x6b, 0x3b, 0x59 };
#define XOR_TABLE_SIZE 37
- const unsigned char xor_table[XOR_TABLE_SIZE] = {
+ static const unsigned char xor_table[XOR_TABLE_SIZE] = {
0x05, 0x18, 0x74, 0xd0, 0x0d, 0x09, 0x02, 0x53,
0xc0, 0x01, 0x05, 0x05, 0x67, 0x03, 0x19, 0x70,
0x08, 0x27, 0x66, 0x10, 0x10, 0x72, 0x08, 0x09,
diff --git a/libavformat/smoothstreamingenc.c b/libavformat/smoothstreamingenc.c
index bf1f8d49d6..065ecc2ee4 100644
--- a/libavformat/smoothstreamingenc.c
+++ b/libavformat/smoothstreamingenc.c
@@ -450,7 +450,7 @@ static int parse_fragment(AVFormatContext *s, const char *filename, int64_t *sta
if (len < 8 || len >= *moof_size)
goto fail;
if (tag == MKTAG('u','u','i','d')) {
- const uint8_t tfxd[] = {
+ static const uint8_t tfxd[] = {
0x6d, 0x1d, 0x9b, 0x05, 0x42, 0xd5, 0x44, 0xe6,
0x80, 0xe2, 0x14, 0x1d, 0xaf, 0xf7, 0x57, 0xb2
};
diff --git a/libavformat/spdifenc.c b/libavformat/spdifenc.c
index 368da03fc6..a19bcab4c9 100644
--- a/libavformat/spdifenc.c
+++ b/libavformat/spdifenc.c
@@ -398,15 +398,15 @@ static int spdif_header_truehd(AVFormatContext *s, AVPacket *pkt)
{
IEC61937Context *ctx = s->priv_data;
int mat_code_length = 0;
- const char mat_end_code[16] = { 0xC3, 0xC2, 0xC0, 0xC4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x97, 0x11 };
+ static const char mat_end_code[16] = { 0xC3, 0xC2, 0xC0, 0xC4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x97, 0x11 };
if (!ctx->hd_buf_count) {
- const char mat_start_code[20] = { 0x07, 0x9E, 0x00, 0x03, 0x84, 0x01, 0x01, 0x01, 0x80, 0x00, 0x56, 0xA5, 0x3B, 0xF4, 0x81, 0x83, 0x49, 0x80, 0x77, 0xE0 };
+ static const char mat_start_code[20] = { 0x07, 0x9E, 0x00, 0x03, 0x84, 0x01, 0x01, 0x01, 0x80, 0x00, 0x56, 0xA5, 0x3B, 0xF4, 0x81, 0x83, 0x49, 0x80, 0x77, 0xE0 };
mat_code_length = sizeof(mat_start_code) + BURST_HEADER_SIZE;
memcpy(ctx->hd_buf, mat_start_code, sizeof(mat_start_code));
} else if (ctx->hd_buf_count == 12) {
- const char mat_middle_code[12] = { 0xC3, 0xC1, 0x42, 0x49, 0x3B, 0xFA, 0x82, 0x83, 0x49, 0x80, 0x77, 0xE0 };
+ static const char mat_middle_code[12] = { 0xC3, 0xC1, 0x42, 0x49, 0x3B, 0xFA, 0x82, 0x83, 0x49, 0x80, 0x77, 0xE0 };
mat_code_length = sizeof(mat_middle_code) + MAT_MIDDLE_CODE_OFFSET;
memcpy(&ctx->hd_buf[12 * TRUEHD_FRAME_OFFSET - BURST_HEADER_SIZE + MAT_MIDDLE_CODE_OFFSET],
mat_middle_code, sizeof(mat_middle_code));