diff --git a/src/zm_event.cpp b/src/zm_event.cpp index 23d4525a9..432f4841f 100644 --- a/src/zm_event.cpp +++ b/src/zm_event.cpp @@ -650,7 +650,7 @@ bool EventStream::loadEventData( int event_id ) mysql_free_result( result ); - if ( mode == MODE_ALL_GAPLESS ) + if ( forceEventChange || mode == MODE_ALL_GAPLESS ) { if ( replay_rate > 0 ) curr_stream_time = event_data->frames[0].timestamp; @@ -849,6 +849,8 @@ void EventStream::processCommand( const CmdMsg *msg ) curr_frame_id = 0; else curr_frame_id = event_data->frame_count-1; + paused = false; + forceEventChange = true; break; } case CMD_NEXT : @@ -858,6 +860,8 @@ void EventStream::processCommand( const CmdMsg *msg ) curr_frame_id = event_data->frame_count-1; else curr_frame_id = 0; + paused = false; + forceEventChange = true; break; } case CMD_SEEK : @@ -971,7 +975,7 @@ mysql_free_result( $result ); if ( reload_event ) { - if ( mode != MODE_SINGLE ) + if ( forceEventChange || mode != MODE_SINGLE ) { //Info(( "SQL:%s", sql )); if ( mysql_query( &dbconn, sql ) ) @@ -1017,6 +1021,7 @@ mysql_free_result( $result ); paused = true; } mysql_free_result( result ); + forceEventChange = false; } else { diff --git a/src/zm_event.h b/src/zm_event.h index 630fe4516..715b20022 100644 --- a/src/zm_event.h +++ b/src/zm_event.h @@ -206,6 +206,7 @@ protected: protected: StreamMode mode; + bool forceEventChange; protected: int curr_frame_id; @@ -227,6 +228,8 @@ public: { mode = DEFAULT_MODE; + forceEventChange = false; + curr_frame_id = 0; curr_stream_time = 0.0; diff --git a/web/zm_html_js.php b/web/zm_html_js.php index 12f8bcbf9..09e436a73 100644 --- a/web/zm_html_js.php +++ b/web/zm_html_js.php @@ -28,6 +28,8 @@