46 return (sscanf(ptr,
"%*u:%*u:%*u.%*u %*u:%*u:%*u.%*u %c", &c) == 1 ||
47 sscanf(ptr,
"@%*u @%*u %c", &c) == 1);
52 const char *ptr = p->
buf;
58 while (ptr < ptr_end) {
61 if (*ptr !=
'#' && *ptr !=
'\n') {
66 ptr += strcspn(ptr,
"\n") + 1;
71 static const char *
const cmds[] = {
106 unsigned hs, ms, ss, fs;
107 unsigned he,
me, se, fe;
108 int ts_start, ts_end;
111 if (sscanf(buf,
"%u:%u:%u.%u %u:%u:%u.%u %n",
113 &he, &me, &se, &fe, &len) == 8) {
114 ts_start = (hs*3600 + ms*60 + ss) * jacosub->
timeres + fs;
115 ts_end = (he*3600 + me*60 + se) * jacosub->
timeres + fe;
120 if (sscanf(buf,
"@%u @%u %n", &ts_start, &ts_end, &len) == 2)
126 ts_start = (ts_start + jacosub->
shift) * 100 / jacosub->
timeres;
127 ts_end = (ts_end + jacosub->
shift) * 100 / jacosub->
timeres;
129 *duration = ts_start + ts_end;
136 int a = 0,
b = 0,
c = 0, d = 0;
137 #define SSEP "%*1[.:]"
141 if (*buf ==
'-' || a < 0) {
147 case 4:
return sign * ((a*3600 +
b*60 +
c) * timeres + d);
148 case 3:
return sign * (( a*60 +
b) * timeres +
c);
149 case 2:
return sign * ((
a) * timeres +
b);
178 const char *p = line;
192 merge_line = len > 1 && !strcmp(&line[len - 2],
"\\\n");
205 cmd_len = strlen(
cmds[i]);
213 switch (
cmds[i][0]) {
222 jacosub->
timeres = strtol(p, NULL, 10);
238 for (i = 0; i < jacosub->
q.
nb_subs; i++) {
254 int64_t min_ts, int64_t ts, int64_t max_ts,
int flags)
258 min_ts, ts, max_ts, flags);