From d0e3247db92f57a08fc6ec8c984259837834dba5 Mon Sep 17 00:00:00 2001 From: stan Date: Tue, 27 Dec 2005 14:40:15 +0000 Subject: [PATCH] Moved state transitions to before actions. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1741 e3e1d417-86f3-4887-817a-d78f3d33393f --- src/zm_monitor.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index 3a1048a8b..3bc4eb82f 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -809,6 +809,8 @@ bool Monitor::Analyse() } if ( !event ) { + shared_data->state = state = TAPE; + // Create event event = new Event( this, *timestamp, "Continuous" ); shared_data->last_event = event->Id(); @@ -830,7 +832,6 @@ bool Monitor::Analyse() } event->AddFrames( pre_event_count, images, timestamps ); } - shared_data->state = state = TAPE; } } if ( score ) @@ -840,6 +841,7 @@ bool Monitor::Analyse() if ( Event::PreAlarmCount() >= (alarm_frame_count-1) ) { Info(( "%s: %03d - Gone into alarm state", name, image_count )); + shared_data->state = state = ALARM; if ( function != MOCORD && state != ALERT ) { int pre_index; @@ -872,7 +874,6 @@ bool Monitor::Analyse() event->SavePreAlarmFrames(); } } - shared_data->state = state = ALARM; } else if ( state != PREALARM ) {