From: Steinar H. Gunderson Date: Mon, 17 Jul 2023 16:27:40 +0000 (+0200) Subject: Fix absolute seeking when the base rate is not 1/1000. X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=280e1391ec1d4ea4e498377726d7613874335943;p=pkanalytics Fix absolute seeking when the base rate is not 1/1000. --- diff --git a/video_widget.cpp b/video_widget.cpp index f8db900..0a7ff43 100644 --- a/video_widget.cpp +++ b/video_widget.cpp @@ -139,7 +139,7 @@ bool VideoWidget::process_queued_commands(AVFormatContext *format_ctx, AVCodecCo relative_seek_ms += cmd.relative_seek_ms; relative_seek_frames += cmd.relative_seek_frames; } else if (cmd.command == QueuedCommand::SEEK_ABSOLUTE) { - base_pts = cmd.seek_ms; + base_pts = av_rescale_q(cmd.seek_ms, AVRational{ 1, 1000 }, video_timebase); relative_seek_ms = 0; relative_seek_frames = 0; }