summaryrefslogtreecommitdiff
path: root/src/client/cl_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/cl_main.c')
-rw-r--r--src/client/cl_main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client/cl_main.c b/src/client/cl_main.c
index d597e29a..564c5406 100644
--- a/src/client/cl_main.c
+++ b/src/client/cl_main.c
@@ -3009,13 +3009,13 @@ void CL_Frame ( int msec ) {
if ( CL_VideoRecording( ) && cl_aviFrameRate->integer && msec) {
// save the current screen
if ( clc.state == CA_ACTIVE || cl_forceavidemo->integer) {
+ float fps = MIN(cl_aviFrameRate->value * com_timescale->value, 1000.0f);
+ float frameDuration = MAX(1000.0f / fps, 1.0f) + clc.aviVideoFrameRemainder;
+
CL_TakeVideoFrame( );
- // fixed time for next frame'
- msec = (int)ceil( (1000.0f / cl_aviFrameRate->value) * com_timescale->value );
- if (msec == 0) {
- msec = 1;
- }
+ msec = (int)frameDuration;
+ clc.aviVideoFrameRemainder = frameDuration - msec;
}
}