hedgewars/uVideoRec.pas
changeset 13500 b5f8864a38d3
parent 13498 3bb07c847886
child 13518 d8462cc9d42d
--- a/hedgewars/uVideoRec.pas	Tue Jul 17 12:55:07 2018 +0200
+++ b/hedgewars/uVideoRec.pas	Tue Jul 17 14:20:58 2018 +0200
@@ -48,7 +48,7 @@
 procedure freeModule;
 
 implementation
-uses uVariables, GLunit, SDLh, SysUtils, uUtils, uIO, uMisc, uTypes, uDebug;
+uses uVariables, GLunit, SDLh, SysUtils, uUtils, uIO, uMisc, uConsts, uTypes, uDebug;
 
 type TAddFileLogRaw = procedure (s: pchar); cdecl;
 const AvwrapperLibName = 'libavwrapper';
@@ -153,7 +153,10 @@
     FreeMem(RGB_Buffer, 4*numPixels);
     Close(cameraFile);
     if AVWrapper_Close() < 0 then
-        halt(-1);
+        begin
+        AddFileLog('AVWrapper_Close() has failed.');
+        halt(HaltVideoRec);
+        end;
     Erase(cameraFile);
     if recordAudio then
         DeleteFile(soundFilePath);
@@ -167,7 +170,10 @@
     glReadPixels(0, 0, cScreenWidth, cScreenHeight, GL_RGBA, GL_UNSIGNED_BYTE, RGB_Buffer);
 
     if AVWrapper_WriteFrame(RGB_Buffer) < 0 then
-        halt(-1);
+        begin
+        AddFileLog('AVWrapper_WriteFrame(RGB_Buffer) has failed.');
+        halt(HaltVideoRec);
+        end;
 
     // inform frontend that we have encoded new frame
     s[0]:= #3;