From: havoc Date: Wed, 27 Oct 2004 18:18:05 +0000 (+0000) Subject: now aborts video capture if it falls behind by more than a second (as the sound is... X-Git-Tag: xonotic-v0.1.0preview~5411 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4783df41f6ff0d12c21d4fb13dfb56447c4a8e7c;p=xonotic%2Fdarkplaces.git now aborts video capture if it falls behind by more than a second (as the sound is likely hosed in that case) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4718 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_screen.c b/cl_screen.c index dc31497b..f6d2eee2 100644 --- a/cl_screen.c +++ b/cl_screen.c @@ -882,7 +882,7 @@ void SCR_CaptureVideo_SoundFrame(qbyte *bufstereo16le, size_t length, int rate) void SCR_CaptureVideo(void) { - int newframenum; + int newframenum, c; if (cl_capturevideo.integer) { if (!cl_capturevideo_active) @@ -893,14 +893,18 @@ void SCR_CaptureVideo(void) Cvar_SetValueQuick(&cl_capturevideo_fps, cl_capturevideo_framerate); } newframenum = (Sys_DoubleTime() - cl_capturevideo_starttime) * cl_capturevideo_framerate; + c = (int)ceil(cl_capturevideo_framerate); while (cl_capturevideo_frame < newframenum) { - if (SCR_CaptureVideo_VideoFrame()) + if ((c--) && SCR_CaptureVideo_VideoFrame()) cl_capturevideo_frame++; else { Cvar_SetValueQuick(&cl_capturevideo, 0); - Con_Printf("video saving failed on frame %i, out of disk space? stopping avi demo capture.\n", cl_capturevideo_frame); + if (c == 0) + Con_Printf("video saving failed on frame %i, your machine is too slow for this capture speed.\n", cl_capturevideo_frame); + else + Con_Printf("video saving failed on frame %i, out of disk space? stopping video capture.\n", cl_capturevideo_frame); SCR_CaptureVideo_EndVideo(); break; }