47 return (sscanf(ptr,
"%*u:%*u:%*u.%*u %*u:%*u:%*u.%*u %c", &c) == 1 ||
48 (sscanf(ptr,
"@%u @%u %c", &fs, &fe, &c) == 3 && fs < fe));
53 const char *ptr = p->
buf;
59 while (ptr < ptr_end) {
62 if (*ptr !=
'#' && *ptr !=
'\n') {
72 static const char *
const cmds[] = {
107 unsigned hs, ms, ss, fs;
108 unsigned he,
me, se, fe;
109 int ts_start, ts_end;
112 if (sscanf(buf,
"%u:%u:%u.%u %u:%u:%u.%u %n",
114 &he, &me, &se, &fe, &len) == 8) {
115 ts_start = (hs*3600 + ms*60 + ss) * jacosub->
timeres + fs;
116 ts_end = (he*3600 + me*60 + se) * jacosub->
timeres + fe;
121 if (sscanf(buf,
"@%u @%u %n", &ts_start, &ts_end, &len) == 2)
127 ts_start = (ts_start + jacosub->
shift) * 100 / jacosub->
timeres;
128 ts_end = (ts_end + jacosub->
shift) * 100 / jacosub->
timeres;
130 *duration = ts_start + ts_end;
137 int a = 0,
b = 0,
c = 0, d = 0;
138 #define SSEP "%*1[.:]"
142 if (*buf ==
'-' || a < 0) {
148 case 4:
return sign * ((a*3600 +
b*60 +
c) * timeres + d);
149 case 3:
return sign * (( a*60 +
b) * timeres +
c);
150 case 2:
return sign * ((
a) * timeres +
b);
179 const char *p = line;
193 merge_line = len > 1 && !strcmp(&line[len - 2],
"\\\n");
206 cmd_len = strlen(
cmds[i]);
214 switch (
cmds[i][0]) {
223 jacosub->
timeres = strtol(p, NULL, 10);
239 for (i = 0; i < jacosub->
q.
nb_subs; i++) {
255 int64_t min_ts, int64_t ts, int64_t max_ts,
int flags)
259 min_ts, ts, max_ts, flags);