33 for (i = 0; i < 2; i++)
35 if (strncmp(
"\xFF\xFE", r->
buf, 2) == 0) {
38 }
else if (strncmp(
"\xFE\xFF", r->
buf, 2) == 0) {
43 if (strncmp(
"\xEF\xBB\xBF", r->
buf, 3) == 0) {
50 "UTF16 is automatically converted to UTF8, do not specify a character encoding\n");
88 for ( ; size > 0; size--)
124 memcpy(sub->
data + old_len, event, len);
140 memcpy(sub->
data, event, len);
152 return s1->
pos > s2->
pos ? 1 : -1;
154 return s1->
pts > s2->
pts ? 1 : -1;
164 return s1->
pts > s2->
pts ? 1 : -1;
166 return s1->
pos > s2->
pos ? 1 : -1;
176 for (i = 0; i < q->
nb_subs; i++)
219 int64_t min_ts, int64_t ts, int64_t max_ts,
int flags)
224 if (ts < 0 || ts >= q->
nb_subs)
236 for (i = idx; i > 0 && q->
subs[i].
pts > max_ts; i--)
240 ts_selected = q->
subs[idx].
pts;
241 if (ts_selected < min_ts || ts_selected > max_ts)
245 for (i = idx - 1; i >= 0; i--) {
250 if (pts >= min_ts && pts > ts_selected - q->
subs[i].
duration)
261 if (stream_index == -1)
274 for (i = 0; i < q->
nb_subs; i++)
290 end_chr = *c ==
'<' ?
'>' :
'<';
295 }
while (*c != end_chr && *c);
296 if (end_chr ==
'>') {
306 const int len = strlen(attr);
312 in_quotes ^= *s ==
'"';
318 return s + len + 1 + (s[len + 1] ==
'"');
325 return c ==
'\r' || c ==
'\n';
330 char eol_buf[5], last_was_cr = 0;
331 int n = 0, i = 0, nb_eol = 0;
347 nb_eol += c ==
'\n' || last_was_cr;
351 if (i ==
sizeof(eol_buf) - 1)
353 last_was_cr = c ==
'\r';
384 while (cur + 1 < size) {
388 if (c ==
'\r' || c ==
'\n')