From 422020a3b26766392cf759ec30fe938f640dbfde Mon Sep 17 00:00:00 2001 From: rwg0 Date: Wed, 22 Apr 2015 21:53:20 +0100 Subject: [PATCH] Fix fast forward/reverse in event playback not being fast if effectivefps < maxfps --- src/zm_event.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/zm_event.cpp b/src/zm_event.cpp index 464fe7e56..3e723fa48 100644 --- a/src/zm_event.cpp +++ b/src/zm_event.cpp @@ -1428,8 +1428,10 @@ void EventStream::runStream() if ( ((curr_frame_id-1)%frame_mod) == 0 ) { delta_us = (unsigned int)(frame_data->delta * 1000000); - if ( effective_fps < base_fps ) - delta_us = (unsigned int)((delta_us * base_fps)/effective_fps); + // if effective > base we should speed up frame delivery + delta_us = (unsigned int)((delta_us * base_fps)/effective_fps); + // but must not exceed maxfps + delta_us = max(delta_us, 1000000 / maxfps); send_frame = true; } }