comparison xsubdec.c @ 6218:dfdff1ca78a7 libavcodec

consts I have underestimated this a little, and these are just some ...
author michael
date Fri, 01 Feb 2008 03:26:31 +0000
parents 1900b70712ab
children 48759bfbd073
comparison
equal deleted inserted replaced
6217:f838213ca91b 6218:dfdff1ca78a7
28 } 28 }
29 29
30 static const uint8_t tc_offsets[9] = { 0, 1, 3, 4, 6, 7, 9, 10, 11 }; 30 static const uint8_t tc_offsets[9] = { 0, 1, 3, 4, 6, 7, 9, 10, 11 };
31 static const uint8_t tc_muls[9] = { 10, 6, 10, 6, 10, 6, 10, 10, 1 }; 31 static const uint8_t tc_muls[9] = { 10, 6, 10, 6, 10, 6, 10, 10, 1 };
32 32
33 static uint64_t parse_timecode(uint8_t *buf) { 33 static uint64_t parse_timecode(const uint8_t *buf) {
34 int i; 34 int i;
35 int64_t ms = 0; 35 int64_t ms = 0;
36 if (buf[2] != ':' || buf[5] != ':' || buf[8] != '.') 36 if (buf[2] != ':' || buf[5] != ':' || buf[8] != '.')
37 return AV_NOPTS_VALUE; 37 return AV_NOPTS_VALUE;
38 for (i = 0; i < sizeof(tc_offsets); i++) { 38 for (i = 0; i < sizeof(tc_offsets); i++) {
42 } 42 }
43 return ms; 43 return ms;
44 } 44 }
45 45
46 static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, 46 static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
47 uint8_t *buf, int buf_size) { 47 const uint8_t *buf, int buf_size) {
48 AVSubtitle *sub = data; 48 AVSubtitle *sub = data;
49 uint8_t *buf_end = buf + buf_size; 49 const uint8_t *buf_end = buf + buf_size;
50 uint8_t *bitmap; 50 uint8_t *bitmap;
51 int w, h, x, y, rlelen, i; 51 int w, h, x, y, rlelen, i;
52 GetBitContext gb; 52 GetBitContext gb;
53 53
54 // check that at least header fits 54 // check that at least header fits