(sscanf(ptr, "@%u @%u %c", &fs, &fe, &c) == 3 && fs < fe));
}
-static int jacosub_probe(AVProbeData *p)
+static int jacosub_probe(const AVProbeData *p)
{
const char *ptr = p->buf;
const char *ptr_end = p->buf + p->buf_size;
unsigned hs, ms, ss, fs; // hours, minutes, seconds, frame start
unsigned he, me, se, fe; // hours, minutes, seconds, frame end
int ts_start, ts_end;
+ int64_t ts_start64, ts_end64;
/* timed format */
if (sscanf(buf, "%u:%u:%u.%u %u:%u:%u.%u %n",
return NULL;
shift_and_ret:
- ts_start = (ts_start + jacosub->shift) * 100 / jacosub->timeres;
- ts_end = (ts_end + jacosub->shift) * 100 / jacosub->timeres;
- *start = ts_start;
- *duration = ts_start + ts_end;
+ ts_start64 = (ts_start + jacosub->shift) * 100LL / jacosub->timeres;
+ ts_end64 = (ts_end + jacosub->shift) * 100LL / jacosub->timeres;
+ *start = ts_start64;
+ *duration = ts_end64 - ts_start64;
return buf + len;
}