Fix SLOW FWD not working

This commit is contained in:
Isaac Connor 2020-03-26 12:06:07 -04:00
parent 2bd805c1f1
commit cbda9848ab
1 changed files with 5 additions and 7 deletions

View File

@ -76,7 +76,7 @@ bool EventStream::loadInitialEventData(int monitor_id, time_t event_time) {
curr_frame_id = 1; // curr_frame_id is 1-based curr_frame_id = 1; // curr_frame_id is 1-based
if ( event_time >= event_data->start_time ) { if ( event_time >= event_data->start_time ) {
Debug(2, "event time is after event start"); Debug(2, "event time is after event start");
for (unsigned int i = 0; i < event_data->frame_count; i++ ) { for ( unsigned int i = 0; i < event_data->frame_count; i++ ) {
//Info( "eft %d > et %d", event_data->frames[i].timestamp, event_time ); //Info( "eft %d > et %d", event_data->frames[i].timestamp, event_time );
if ( event_data->frames[i].timestamp >= event_time ) { if ( event_data->frames[i].timestamp >= event_time ) {
curr_frame_id = i+1; curr_frame_id = i+1;
@ -378,6 +378,8 @@ void EventStream::processCommand(const CmdMsg *msg) {
paused = true; paused = true;
replay_rate = ZM_RATE_BASE; replay_rate = ZM_RATE_BASE;
step = 1; step = 1;
if ( (unsigned int)curr_frame_id < event_data->frame_count )
curr_frame_id += 1;
break; break;
case CMD_SLOWREV : case CMD_SLOWREV :
Debug(1, "Got SLOW REV command"); Debug(1, "Got SLOW REV command");
@ -848,20 +850,15 @@ void EventStream::runStream() {
// commands may set send_frame to true // commands may set send_frame to true
while ( checkCommandQueue() && !zm_terminate ) { while ( checkCommandQueue() && !zm_terminate ) {
// The idea is to loop here processing all commands before proceeding. // The idea is to loop here processing all commands before proceeding.
Debug(1, "Have command queue");
} }
Debug(2, "Done command queue");
// Update modified time of the socket .lock file so that we can tell which ones are stale. // Update modified time of the socket .lock file so that we can tell which ones are stale.
if ( now.tv_sec - last_comm_update.tv_sec > 3600 ) { if ( now.tv_sec - last_comm_update.tv_sec > 3600 ) {
touch(sock_path_lock); touch(sock_path_lock);
last_comm_update = now; last_comm_update = now;
} }
} else {
Debug(2, "Not checking command queue");
} }
// Get current frame data // Get current frame data
FrameData *frame_data = &event_data->frames[curr_frame_id-1]; FrameData *frame_data = &event_data->frames[curr_frame_id-1];
@ -1017,6 +1014,7 @@ void EventStream::runStream() {
curr_frame_id += step; curr_frame_id += step;
// Detects when we hit end of event and will load the next event or previous event // Detects when we hit end of event and will load the next event or previous event
if ( !paused )
checkEventLoaded(); checkEventLoaded();
} // end while ! zm_terminate } // end while ! zm_terminate
#if HAVE_LIBAVCODEC #if HAVE_LIBAVCODEC