From 75fb755db7cc6e1ec9f0aa3e82c7079bd28eb4dd Mon Sep 17 00:00:00 2001 From: Julien BLACHE Date: Mon, 13 Sep 2010 21:50:22 +0200 Subject: [PATCH] Assign ms to target_pts to ensure full 64bit computation of target_pts Clang produced interesting results without this (or casting ms to int64_t), as the seek target got mis-computed and fell short of the requested seek target in ms (ex. wanted 18569 ms -> got 555 ms). --- src/transcode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/transcode.c b/src/transcode.c index 503ff3bf..d9a67992 100644 --- a/src/transcode.c +++ b/src/transcode.c @@ -257,7 +257,8 @@ transcode_seek(struct transcode_ctx *ctx, int ms) start_time = ctx->fmtctx->streams[ctx->astream]->start_time; - target_pts = ms * AV_TIME_BASE / 1000; + target_pts = ms; + target_pts = target_pts * AV_TIME_BASE / 1000; target_pts = av_rescale_q(target_pts, AV_TIME_BASE_Q, ctx->fmtctx->streams[ctx->astream]->time_base); if ((start_time != AV_NOPTS_VALUE) && (start_time > 0))