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 const char *text[] = {
"false",
"true" }, *p;
160 for (i = 0; i < 2; i++) {
167 if (
BETWEEN(*cur_byte | 32,
'a',
'z'))
180 if ((
unsigned)*cur_byte -
'0' > 9)
182 while (
BETWEEN(*cur_byte,
'0',
'9')) {
183 val = val * 10 + (*cur_byte -
'0');
192 int ret, cur_byte, start_of_par;
202 if (ret < 0 || strcmp(label.str,
"captions"))
218 if (!strcmp(label.str,
"startOfParagraph")) {
222 }
else if (!strcmp(label.str,
"content")) {
226 }
else if (!strcmp(label.str,
"startTime")) {
230 }
else if (!strcmp(label.str,
"duration")) {
231 ret =
parse_int(pb, &cur_byte, &duration);
325 static const char *
const tags[] = {
326 "\"captions\"",
"\"duration\"",
"\"content\"",
327 "\"startOfParagraph\"",
"\"startTime\"",
329 unsigned i,
count = 0;
332 if (p->
buf[strspn(p->
buf,
" \t\r\n")] !=
'{')
335 if (!(t = strstr(p->
buf, tags[i])))
337 t += strlen(tags[i]);
338 t += strspn(t,
" \t\r\n");
347 int64_t min_ts, int64_t ts, int64_t max_ts,
352 min_ts, ts, max_ts, flags);
356 .
name =
"tedcaptions",
359 .priv_class = &tedcaptions_demuxer_class,