From 4783df41f6ff0d12c21d4fb13dfb56447c4a8e7c Mon Sep 17 00:00:00 2001 From: havoc Date: Wed, 27 Oct 2004 18:18:05 +0000 Subject: [PATCH] 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 --- cl_screen.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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; } -- 2.39.2