43 if (!strncmp(ptr,
"WEBVTT", 6) &&
44 (!ptr[6] || strchr(
"\n\r\t ", ptr[6])))
52 if (sscanf(s,
"%u:%u:%u.%u", &hh, &mm, &ss, &ms) == 4)
return (hh*3600LL + mm*60LL + ss) * 1000LL + ms;
53 if (sscanf(s,
"%u:%u.%u", &mm, &ss, &ms) == 3)
return ( mm*60LL + ss) * 1000LL + ms;
77 const char *p, *identifier, *settings;
78 int identifier_len, settings_len;
79 int64_t ts_start, ts_end;
86 p = identifier = cue.str;
90 if (!strncmp(p,
"\xEF\xBB\xBFWEBVTT", 9) ||
91 !strncmp(p,
"WEBVTT", 6))
96 for (i = 0; p[i] && p[i] !=
'\n' && p[i] !=
'\r'; i++) {
97 if (!strncmp(p + i,
"-->", 3)) {
105 identifier_len = strcspn(p,
"\r\n");
116 if (!(p = strstr(p,
"-->")))
119 do p++;
while (*p ==
' ' || *p ==
'\t');
124 p += strcspn(p,
"\n\t ");
125 while (*p ==
'\t' || *p ==
' ')
128 settings_len = strcspn(p,
"\r\n");
145 #define SET_SIDE_DATA(name, type) do { \
147 uint8_t *buf = av_packet_new_side_data(sub, type, name##_len); \
149 res = AVERROR(ENOMEM); \
152 memcpy(buf, name, name##_len); \
175 int64_t min_ts, int64_t ts, int64_t max_ts,
int flags)
179 min_ts, ts, max_ts, flags);