36 const char *
header =
"[Script Info]";
38 if (!memcmp(p->
buf, header, strlen(header)) ||
39 !memcmp(p->
buf + 3, header, strlen(header)))
55 int hh1, mm1, ss1, ms1;
56 int hh2, mm2, ss2, ms2;
58 if (sscanf(p,
"%*[^,],%d:%d:%d%*c%d,%d:%d:%d%*c%d",
59 &hh1, &mm1, &ss1, &ms1,
60 &hh2, &mm2, &ss2, &ms2) == 8) {
61 end = (hh2*3600LL + mm2*60LL + ss2) * 100LL + ms2;
62 *start = (hh1*3600LL + mm1*60LL + ss1) * 100LL + ms1;
63 *duration = end - *
start;
89 int header_remaining, res = 0;
99 header_remaining = INT_MAX;
110 if (!memcmp(line.str,
"[Events]", 8))
111 header_remaining = 2;
112 else if (line.str[0] ==
'[')
113 header_remaining = INT_MAX;
115 if (header_remaining) {
123 if (
read_ts(line.str, &ts_start, &duration) < 0)
155 int64_t min_ts, int64_t ts, int64_t max_ts,
int flags)
159 min_ts, ts, max_ts, flags);