From 935d27eb1a081ca49d5b17fc63bface95e404ac9 Mon Sep 17 00:00:00 2001 From: tobigun Date: Sat, 9 Aug 2008 13:16:41 +0000 Subject: check if video was successfully opened. Otherwise a seek might be performed on an uninitialized video. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1250 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 6682a107..656471db 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -493,9 +493,11 @@ begin fShowVisualization := false; if (CurrentSong.Video <> '') and FileExists(CurrentSong.Path + CurrentSong.Video) then begin - fCurrentVideoPlaybackEngine.Open( CurrentSong.Path + CurrentSong.Video ); - fCurrentVideoPlaybackEngine.Position := CurrentSong.VideoGAP + CurrentSong.Start; - CurrentSong.VideoLoaded := true; + if (fCurrentVideoPlaybackEngine.Open( CurrentSong.Path + CurrentSong.Video )) then + begin + fCurrentVideoPlaybackEngine.Position := CurrentSong.VideoGAP + CurrentSong.Start; + CurrentSong.VideoLoaded := true; + end; end; // set background -- cgit v1.2.3