]> git.sesse.net Git - pkanalytics/commitdiff
Fix absolute seeking when the base rate is not 1/1000.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 17 Jul 2023 16:27:40 +0000 (18:27 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 17 Jul 2023 16:27:40 +0000 (18:27 +0200)
video_widget.cpp

index f8db9002b7ba91d2d32cf3ecdd0fcdeaea09e702..0a7ff43eb7b2f4f77637e2553b9717e73e3653da 100644 (file)
@@ -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;
                }