diff options
author | b1indy <b1indy@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-11-23 18:35:35 +0000 |
---|---|---|
committer | b1indy <b1indy@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-11-23 18:35:35 +0000 |
commit | 37f95ec89bfabb61616a996785a19400c8222395 (patch) | |
tree | b6d9c6d561e755d61d83aac9e1c316ddf3634a4e /Game/Code/Classes | |
parent | bfb30f68451f1b23c9a8b56b3624653edadaa777 (diff) | |
download | usdx-37f95ec89bfabb61616a996785a19400c8222395.tar.gz usdx-37f95ec89bfabb61616a996785a19400c8222395.tar.xz usdx-37f95ec89bfabb61616a996785a19400c8222395.zip |
"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
Diffstat (limited to 'Game/Code/Classes')
-rw-r--r-- | Game/Code/Classes/UVideo.pas | 4 |
1 files changed, 3 insertions, 1 deletions
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; |