X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=libavformat%2Fjacosubdec.c;h=121c86d659687ecd224711e429af6a488826261c;hb=1a944563907b0a8dc1aa9231dc42d8fc8eeb2de4;hp=520c435cc5afc8f41f4b79cea8dbddf47ab44209;hpb=f4cf6ba8c9646814af842a99335c6ee312ded299;p=ffmpeg diff --git a/libavformat/jacosubdec.c b/libavformat/jacosubdec.c index 520c435cc5a..121c86d6596 100644 --- a/libavformat/jacosubdec.c +++ b/libavformat/jacosubdec.c @@ -48,7 +48,7 @@ static int timed_line(const char *ptr) (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; @@ -107,6 +107,7 @@ static const char *read_ts(JACOsubContext *jacosub, const char *buf, 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", @@ -124,10 +125,10 @@ static const char *read_ts(JACOsubContext *jacosub, const char *buf, 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; }