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).
This commit is contained in:
Julien BLACHE 2010-09-13 21:50:22 +02:00
parent 115ded61d0
commit 75fb755db7

View File

@ -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))