From 8d45ef9b08de96a0037ac9e245a84b7730228736 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Sun, 20 May 2007 09:40:48 +0000 Subject: An effort to make a workaround for the many Crashes when a Video File ist corrupted. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@225 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'Game/Code') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index cdce5984..3899a4ed 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -730,7 +730,23 @@ end; procedure TScreenSing.onShowFinish; begin // play movie (II) - if AktSong.VideoLoaded then PlaySmpeg; + + if AktSong.VideoLoaded then + begin + try + PlaySmpeg; + except + //If an Error occurs Reading Video: prevent Video from being Drawn again and Close Video + AktSong.VideoLoaded := False; + Log.LogError('Error drawing Video, Video has been disabled for this Song/Session.'); + Log.LogError('Corrupted File: ' + AktSong.Video); + try + CloseSmpeg; + except + + end; + end; + end; // play music (II) Music.Play; @@ -1039,7 +1055,19 @@ begin SingDrawBackground; // update and draw movie if ShowFinish and AktSong.VideoLoaded then begin - UpdateSmpeg; // this only draws + try + UpdateSmpeg; // this only draws + except + //If an Error occurs drawing: prevent Video from being Drawn again and Close Video + AktSong.VideoLoaded := False; + log.LogError('Error drawing Video, Video has been disabled for this Song/Session.'); + Log.LogError('Corrupted File: ' + AktSong.Video); + try + CloseSmpeg; + except + + end; + end; end; // draw static menu (FG) -- cgit v1.2.3