comparison xsubdec.c @ 5492:922a668222f0 libavcodec

Remove AVCodecContext parameter from parse_timecode function
author reimar
date Sun, 05 Aug 2007 12:11:31 +0000
parents d847cbc8756b
children 80b481ec72a6
comparison
equal deleted inserted replaced
5491:d847cbc8756b 5492:922a668222f0
8 } 8 }
9 9
10 static const uint8_t tc_offsets[9] = { 0, 1, 3, 4, 6, 7, 9, 10, 11 }; 10 static const uint8_t tc_offsets[9] = { 0, 1, 3, 4, 6, 7, 9, 10, 11 };
11 static const uint8_t tc_muls[9] = { 10, 6, 10, 6, 10, 6, 10, 10, 1 }; 11 static const uint8_t tc_muls[9] = { 10, 6, 10, 6, 10, 6, 10, 10, 1 };
12 12
13 static uint64_t parse_timecode(AVCodecContext *avctx, uint8_t *buf) { 13 static uint64_t parse_timecode(uint8_t *buf) {
14 int i; 14 int i;
15 int64_t ms = 0; 15 int64_t ms = 0;
16 if (buf[2] != ':' || buf[5] != ':' || buf[8] != '.') 16 if (buf[2] != ':' || buf[5] != ':' || buf[8] != '.')
17 return AV_NOPTS_VALUE; 17 return AV_NOPTS_VALUE;
18 for (i = 0; i < sizeof(tc_offsets); i++) { 18 for (i = 0; i < sizeof(tc_offsets); i++) {
40 // read start and end time 40 // read start and end time
41 if (buf[0] != '[' || buf[13] != '-' || buf[26] != ']') { 41 if (buf[0] != '[' || buf[13] != '-' || buf[26] != ']') {
42 av_log(avctx, AV_LOG_ERROR, "invalid time code\n"); 42 av_log(avctx, AV_LOG_ERROR, "invalid time code\n");
43 return -1; 43 return -1;
44 } 44 }
45 sub->start_display_time = parse_timecode(avctx, buf + 1); 45 sub->start_display_time = parse_timecode(buf + 1);
46 sub->end_display_time = parse_timecode(avctx, buf + 14); 46 sub->end_display_time = parse_timecode(buf + 14);
47 buf += 27; 47 buf += 27;
48 48
49 // read header 49 // read header
50 w = bytestream_get_le16(&buf); 50 w = bytestream_get_le16(&buf);
51 h = bytestream_get_le16(&buf); 51 h = bytestream_get_le16(&buf);