From ffa911adb5788c1053b8a8c9c67dece212afe254 Mon Sep 17 00:00:00 2001 From: stan Date: Fri, 6 Feb 2004 09:21:57 +0000 Subject: [PATCH] Fixed timing problem in streaming. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@817 e3e1d417-86f3-4887-817a-d78f3d33393f --- src/zm_event.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/zm_event.cpp b/src/zm_event.cpp index e34f7e845..4ae2b34b6 100644 --- a/src/zm_event.cpp +++ b/src/zm_event.cpp @@ -394,11 +394,12 @@ void Event::StreamEvent( int event_id, int rate, int scale, FILE *fd ) { if ( rate ) { + double this_delta = atof(dbrow[2]); if ( i ) { gettimeofday( &now, &dummy_tz ); - double frame_delta = atof(dbrow[3])-last_delta; + double frame_delta = this_delta-last_delta; DELTA_TIMEVAL( delta_time, now, last_now, DT_PREC_6 ); int delay = (int)((DT_GRAN_1000000*frame_delta))-delta_time.delta; @@ -412,7 +413,7 @@ void Event::StreamEvent( int event_id, int rate, int scale, FILE *fd ) if ( delay > 0 ) usleep( delay ); } - last_delta = atof(dbrow[3]); + last_delta = this_delta; gettimeofday( &last_now, &dummy_tz ); } static char filepath[PATH_MAX];