notify anyone waiting in packetqueue before waiting on a packet in motion detection. Should fix decode lockup
This commit is contained in:
parent
c7aa41502a
commit
120d9764bc
|
@ -1846,6 +1846,7 @@ bool Monitor::Analyse() {
|
||||||
while (!snap->decoded and !zm_terminate and !analysis_thread->Stopped()) {
|
while (!snap->decoded and !zm_terminate and !analysis_thread->Stopped()) {
|
||||||
// Need to wait for the decoder thread.
|
// Need to wait for the decoder thread.
|
||||||
Debug(1, "Waiting for decode");
|
Debug(1, "Waiting for decode");
|
||||||
|
packetqueue.notify_all(); // decode might be waiting
|
||||||
packet_lock->wait();
|
packet_lock->wait();
|
||||||
if (!snap->image and snap->decoded) {
|
if (!snap->image and snap->decoded) {
|
||||||
Debug(1, "No image but was decoded, giving up");
|
Debug(1, "No image but was decoded, giving up");
|
||||||
|
|
|
@ -81,6 +81,7 @@ class PacketQueue {
|
||||||
);
|
);
|
||||||
bool is_there_an_iterator_pointing_to_packet(const std::shared_ptr<ZMPacket> &zm_packet);
|
bool is_there_an_iterator_pointing_to_packet(const std::shared_ptr<ZMPacket> &zm_packet);
|
||||||
void unlock(ZMLockedPacket *lp);
|
void unlock(ZMLockedPacket *lp);
|
||||||
|
void notify_all() { condition.notify_all(); };
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* ZM_PACKETQUEUE_H */
|
#endif /* ZM_PACKETQUEUE_H */
|
||||||
|
|
Loading…
Reference in New Issue