From 0643ec049ea85731c8f1409f3d40d70131147e5d Mon Sep 17 00:00:00 2001 From: tobigun Date: Sat, 12 Jun 2010 13:27:28 +0000 Subject: fix seeking in videos git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2500 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/media/UVideo.pas | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/media') diff --git a/src/media/UVideo.pas b/src/media/UVideo.pas index e8cfbbf7..15493881 100644 --- a/src/media/UVideo.pas +++ b/src/media/UVideo.pas @@ -1315,7 +1315,10 @@ begin fEOF := false; fFrameTexValid := false; - if (av_seek_frame(fFormatContext, fStreamIndex, Floor(Time/fTimeBase), SeekFlags) < 0) then + if (av_seek_frame(fFormatContext, + fStreamIndex, + Round(Time / av_q2d(fStream^.time_base)), + SeekFlags) < 0) then begin Log.LogError('av_seek_frame() failed', 'TVideoPlayback_ffmpeg.SetPosition'); Exit; -- cgit v1.2.3