36 {
"start_time",
"set the start time (offset) of the subtitles, in ms",
38 { .i64 = 15000 }, INT64_MIN, INT64_MAX,
50 #define BETWEEN(a, amin, amax) ((unsigned)((a) - (amin)) <= (amax) - (amin))
52 #define HEX_DIGIT_TEST(c) (BETWEEN(c, '0', '9') || BETWEEN((c) | 32, 'a', 'z'))
53 #define HEX_DIGIT_VAL(c) ((c) <= '9' ? (c) - '0' : ((c) | 32) - 'a' + 10)
54 #define ERR_CODE(c) (c < 0 ? c : AVERROR_INVALIDDATA)
65 av_bprint_chars(bp, (c >> (bytes * 6)) | ((0xFF80 >> bytes) & 0xFF), 1);
66 for (i = bytes - 1; i >= 0; i--)
79 while (*cur_byte ==
' ' || *cur_byte ==
'\t' ||
80 *cur_byte ==
'\n' || *cur_byte ==
'\r')
101 while (*cur_byte > 0 && *cur_byte !=
'"') {
102 if (*cur_byte ==
'\\') {
108 if ((*cur_byte | 32) ==
'u') {
110 for (i = 0; i < 4; i++) {
156 static const char *
const text[] = {
"false",
"true" };
161 for (i = 0; i < 2; i++) {
168 if (
BETWEEN(*cur_byte | 32,
'a',
'z'))
181 if ((
unsigned)*cur_byte -
'0' > 9)
183 while (
BETWEEN(*cur_byte,
'0',
'9')) {
184 val = val * 10 + (*cur_byte -
'0');
193 int ret, cur_byte, start_of_par;
194 AVBPrint label, content;
203 if (ret < 0 || strcmp(label.str,
"captions"))
219 if (!strcmp(label.str,
"startOfParagraph")) {
223 }
else if (!strcmp(label.str,
"content")) {
227 }
else if (!strcmp(label.str,
"startTime")) {
231 }
else if (!strcmp(label.str,
"duration")) {
232 ret =
parse_int(pb, &cur_byte, &duration);
326 static const char *
const tags[] = {
327 "\"captions\"",
"\"duration\"",
"\"content\"",
328 "\"startOfParagraph\"",
"\"startTime\"",
330 unsigned i,
count = 0;
333 if (p->
buf[strspn(p->
buf,
" \t\r\n")] !=
'{')
336 if (!(t = strstr(p->
buf, tags[i])))
338 t += strlen(tags[i]);
339 t += strspn(t,
" \t\r\n");
348 int64_t min_ts, int64_t ts, int64_t max_ts,
353 min_ts, ts, max_ts, flags);
357 .
name =
"tedcaptions",
360 .priv_class = &tedcaptions_demuxer_class,