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",
|
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);
|
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()
|
// Need to guard around event creation/deletion from Reload()
|
||||||
std::lock_guard<std::mutex> lck(event_mutex);
|
std::lock_guard<std::mutex> lck(event_mutex);
|
||||||
|
|
||||||
|
@ -2029,7 +2030,7 @@ bool Monitor::Analyse() {
|
||||||
} else {
|
} else {
|
||||||
Debug(1, "no image so skipping motion detection");
|
Debug(1, "no image so skipping motion detection");
|
||||||
} // end if has image
|
} // end if has image
|
||||||
//score += last_motion_score;
|
//score += last_motion_score;
|
||||||
} else {
|
} else {
|
||||||
Debug(1, "Not Active(%d) enabled %d shared->active %d doing motion detection: %d",
|
Debug(1, "Not Active(%d) enabled %d shared->active %d doing motion detection: %d",
|
||||||
Active(), enabled, shared_data->active,
|
Active(), enabled, shared_data->active,
|
||||||
|
@ -2231,6 +2232,7 @@ bool Monitor::Analyse() {
|
||||||
} // end if ( trigger_data->trigger_state != TRIGGER_OFF )
|
} // end if ( trigger_data->trigger_state != TRIGGER_OFF )
|
||||||
|
|
||||||
if (event) event->AddPacket(snap);
|
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
|
// 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.
|
// from the mp4. So no one will notice anyways.
|
||||||
|
|
Loading…
Reference in New Issue