]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
now aborts video capture if it falls behind by more than a second (as the sound is...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 27 Oct 2004 18:18:05 +0000 (18:18 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 27 Oct 2004 18:18:05 +0000 (18:18 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4718 d7cf8633-e32d-0410-b094-e92efae38249

cl_screen.c

index dc31497bbee356563747fd928d1daa4bfc16fc12..f6d2eee210fa6bd65d4f903a369dea8913c05b83 100644 (file)
@@ -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;
                        }