aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code
diff options
context:
space:
mode:
authormogguh <mogguh@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-11-21 21:13:58 +0000
committermogguh <mogguh@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-11-21 21:13:58 +0000
commit2a2c4ceffa0b352062fbc13cf1033e9c0db6b767 (patch)
tree452842a15bf54a09f253b1cef18df40a61fbc7b6 /Game/Code
parent56400002816820a8baede8c34f69156d574c3b96 (diff)
downloadusdx-2a2c4ceffa0b352062fbc13cf1033e9c0db6b767.tar.gz
usdx-2a2c4ceffa0b352062fbc13cf1033e9c0db6b767.tar.xz
usdx-2a2c4ceffa0b352062fbc13cf1033e9c0db6b767.zip
ffmpeg - flv frame rate hack
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1@624 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code')
-rw-r--r--Game/Code/Classes/UVideo.pas7
1 files changed, 6 insertions, 1 deletions
diff --git a/Game/Code/Classes/UVideo.pas b/Game/Code/Classes/UVideo.pas
index 2040965f..be9a8d52 100644
--- a/Game/Code/Classes/UVideo.pas
+++ b/Game/Code/Classes/UVideo.pas
@@ -33,6 +33,7 @@ uses SDL,
dialogs,
{$endif}
{$ENDIF}
+ dialogs,
UIni;
procedure Init;
@@ -241,18 +242,22 @@ begin
ScaledVideoWidth:=600.0*VideoAspect;
end;
VideoTimeBase:=VideoCodecContext^.time_base.num/VideoCodecContext^.time_base.den;
- // hack to get reasonable timebase for divx
{$ifdef DebugDisplay}
showmessage('framerate: '+inttostr(floor(1/videotimebase))+'fps');
{$endif}
+ // hack to get reasonable timebase (for divx and others)
if VideoTimeBase < 0.02 then // 0.02 <-> 50 fps
begin
VideoTimeBase:=VideoCodecContext^.time_base.den/VideoCodecContext^.time_base.num;
while VideoTimeBase > 50 do VideoTimeBase:=VideoTimeBase/10;
VideoTimeBase:=1/VideoTimeBase;
end;
+ // hack for flv (i always get 1000 fps from the file...)
+ if VideoCodecContext^.codec_id=CODEC_ID_FLV1 then VideoTimeBase:=1/30;
+
{$ifdef DebugDisplay}
showmessage('corrected framerate: '+inttostr(floor(1/videotimebase))+'fps');
+
if ((VideoAspect*VideoCodecContext^.width*VideoCodecContext^.height)>200000) then
showmessage('you are trying to play a rather large video'+#13#10+
'be prepared to experience some timing problems');