39 memcpy(sub->
data + old_len, event, len);
55 memcpy(sub->
data, event, len);
67 return s1->
pos > s2->
pos ? 1 : -1;
69 return s1->
pts > s2->
pts ? 1 : -1;
77 for (i = 0; i < q->
nb_subs; i++)
96 int64_t min_ts, int64_t ts, int64_t max_ts,
int flags)
101 if (ts < 0 || ts >= q->
nb_subs)
106 int64_t min_ts_diff = INT64_MAX;
109 for (i = 0; i < q->
nb_subs; i++) {
111 uint64_t ts_diff =
FFABS(pts - ts);
112 if (pts >= min_ts && pts <= max_ts && ts_diff < min_ts_diff) {
113 min_ts_diff = ts_diff;
120 ts_selected = q->
subs[idx].
pts;
121 for (i = idx - 1; i >= 0; i--) {
138 for (i = 0; i < q->
nb_subs; i++)
154 end_chr = *c ==
'<' ?
'>' :
'<';
159 }
while (*c != end_chr && *c);
160 if (end_chr ==
'>') {
170 const int len = strlen(attr);
176 in_quotes ^= *s ==
'"';
182 return s + len + 1 + (s[len + 1] ==
'"');
189 return c ==
'\r' || c ==
'\n';
195 int n = 0, i = 0, nb_eol = 0;
215 if (i ==
sizeof(eol_buf) - 1)