From 37f95ec89bfabb61616a996785a19400c8222395 Mon Sep 17 00:00:00 2001 From: b1indy Date: Fri, 23 Nov 2007 18:35:35 +0000 Subject: "fixed" seeking in videos to get the desired videogap (now seeks to any frame at the specified time index) (WARNING: this wil most likely result in massive artefacts because the possibility to hit anything but a keyframe is very high for most video codecs (had a divx vid here with 12 seconds between keyframes)) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1@639 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/UVideo.pas | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Game/Code/Classes/UVideo.pas b/Game/Code/Classes/UVideo.pas index c0a4b1f6..91a64939 100644 --- a/Game/Code/Classes/UVideo.pas +++ b/Game/Code/Classes/UVideo.pas @@ -293,11 +293,13 @@ begin end; procedure FFmpegSkip(Time: Single); +var seek_target: uint64; begin VideoSkiptime:=Time; NegativeSkipTime:=Time; if VideoSkipTime > 0 then begin - av_seek_frame(VideoFormatContext,-1,Floor((VideoSkipTime)*1000000),0); +// av_seek_frame(VideoFormatContext,-1,Floor((VideoSkipTime)*1000000),0); + av_seek_frame(VideoFormatContext,VideoStreamIndex,Floor(Time/VideoTimeBase),AVSEEK_FLAG_ANY); VideoTime:=VideoSkipTime; end; end; -- cgit v1.2.3