Use HaltFatalError for all VideoRec failures
authorWuzzy <Wuzzy2@mail.ru>
Wed, 15 May 2019 03:56:00 +0200
changeset 14957 8e4e508d153c
parent 14956 c173fae0a223
child 14958 6c17ef373079
Use HaltFatalError for all VideoRec failures
hedgewars/uConsts.pas
hedgewars/uVideoRec.pas
--- a/hedgewars/uConsts.pas	Wed May 15 03:25:20 2019 +0200
+++ b/hedgewars/uConsts.pas	Wed May 15 03:56:00 2019 +0200
@@ -37,7 +37,6 @@
     HaltFatalError      =  52; // Fatal internal error. See logs for more. Also reports error to frontend
     HaltStartupError    =  53; // Failure loading critical resources
     HaltFatalErrorNoIPC =  54; // Fatal internal error, IPC socket is not available
-    HaltVideoRec        =  55; // Failure while video recording
 
     // for automatic tests
     HaltTestSuccess     =  0;  // Test result: success
--- a/hedgewars/uVideoRec.pas	Wed May 15 03:25:20 2019 +0200
+++ b/hedgewars/uVideoRec.pas	Wed May 15 03:56:00 2019 +0200
@@ -48,7 +48,7 @@
 procedure freeModule;
 
 implementation
-uses uVariables, GLunit, SDLh, SysUtils, uUtils, uIO, uMisc, uConsts, uTypes, uDebug;
+uses uVariables, GLunit, SDLh, SysUtils, uUtils, uIO, uMisc, uTypes, uDebug;
 
 type TAddFileLogRaw = procedure (s: pchar); cdecl;
 const AvwrapperLibName = 'libavwrapper';
@@ -162,8 +162,7 @@
     Close(cameraFile);
     if AVWrapper_Close() < 0 then
         begin
-        AddFileLog('AVWrapper_Close() has failed.');
-        halt(HaltVideoRec);
+        OutError('AVWrapper_Close() has failed.', true);
         end;
 {$IOCHECKS OFF}
     if FileExists(cameraFileName) then
@@ -184,8 +183,7 @@
 
     if AVWrapper_WriteFrame(RGB_Buffer) < 0 then
         begin
-        AddFileLog('AVWrapper_WriteFrame(RGB_Buffer) has failed.');
-        halt(HaltVideoRec);
+        OutError('AVWrapper_WriteFrame(RGB_Buffer) has failed.', true);
         end;
 
     // inform frontend that we have encoded new frame