38 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++)
95 int64_t min_ts, int64_t ts, int64_t max_ts,
int flags)
100 if (ts < 0 || ts >= q->
nb_subs)
105 int64_t min_ts_diff = INT64_MAX;
108 for (i = 0; i < q->
nb_subs; i++) {
110 uint64_t ts_diff =
FFABS(pts - ts);
111 if (pts >= min_ts && pts <= max_ts && ts_diff < min_ts_diff) {
112 min_ts_diff = ts_diff;
119 ts_selected = q->
subs[idx].
pts;
120 for (i = idx - 1; i >= 0; i--) {
137 for (i = 0; i < q->
nb_subs; i++)
153 end_chr = *c ==
'<' ?
'>' :
'<';
158 }
while (*c != end_chr && *c);
159 if (end_chr ==
'>') {
169 const int len = strlen(attr);
175 in_quotes ^= *s ==
'"';
181 return s + len + 1 + (s[len + 1] ==
'"');
188 return c ==
'\r' || c ==
'\n';
194 int n = 0, i = 0, nb_eol = 0;
214 if (i ==
sizeof(eol_buf) - 1)