Use a scope to shorten the lock on event_lock
This commit is contained in:
parent
9240a93ef5
commit
8b99b15b41
|
@ -1853,6 +1853,7 @@ bool Monitor::Analyse() {
|
|||
Debug(3, "Motion detection is enabled signal(%d) signal_change(%d) trigger state(%s) image index %d",
|
||||
signal, signal_change, TriggerState_Strings[trigger_data->trigger_state].c_str(), snap->image_index);
|
||||
|
||||
{ // scope for event lock
|
||||
// Need to guard around event creation/deletion from Reload()
|
||||
std::lock_guard<std::mutex> lck(event_mutex);
|
||||
|
||||
|
@ -2029,7 +2030,7 @@ bool Monitor::Analyse() {
|
|||
} else {
|
||||
Debug(1, "no image so skipping motion detection");
|
||||
} // end if has image
|
||||
//score += last_motion_score;
|
||||
//score += last_motion_score;
|
||||
} else {
|
||||
Debug(1, "Not Active(%d) enabled %d shared->active %d doing motion detection: %d",
|
||||
Active(), enabled, shared_data->active,
|
||||
|
@ -2231,6 +2232,7 @@ bool Monitor::Analyse() {
|
|||
} // end if ( trigger_data->trigger_state != TRIGGER_OFF )
|
||||
|
||||
if (event) event->AddPacket(snap);
|
||||
} // end scope for event_lock
|
||||
|
||||
// In the case where people have pre-alarm frames, the web ui will generate the frame images
|
||||
// from the mp4. So no one will notice anyways.
|
||||
|
|
Loading…
Reference in New Issue