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;
79 return s1->
pts > s2->
pts ? 1 : -1;
81 return s1->
pos > s2->
pos ? 1 : -1;
91 for (i = 0; i < q->
nb_subs; i++)
134 int64_t min_ts, int64_t ts, int64_t max_ts,
int flags)
139 if (ts < 0 || ts >= q->
nb_subs)
151 for (i = idx; i > 0 && q->
subs[i].
pts > max_ts; i--)
155 ts_selected = q->
subs[idx].
pts;
156 if (ts_selected < min_ts || ts_selected > max_ts)
160 for (i = idx - 1; i >= 0; i--) {
165 if (pts >= min_ts && pts > ts_selected - q->
subs[i].
duration)
176 if (stream_index == -1)
189 for (i = 0; i < q->
nb_subs; i++)
205 end_chr = *c ==
'<' ?
'>' :
'<';
210 }
while (*c != end_chr && *c);
211 if (end_chr ==
'>') {
221 const int len = strlen(attr);
227 in_quotes ^= *s ==
'"';
233 return s + len + 1 + (s[len + 1] ==
'"');
240 return c ==
'\r' || c ==
'\n';
245 char eol_buf[5], last_was_cr = 0;
246 int n = 0, i = 0, nb_eol = 0;
262 nb_eol += c ==
'\n' || last_was_cr;
266 if (i ==
sizeof(eol_buf) - 1)
268 last_was_cr = c ==
'\r';