mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2025-12-23 22:37:53 -05:00
Always restart the analysis thread. It is needed. Also free convert_context in Pause
This commit is contained in:
@@ -3453,6 +3453,11 @@ int Monitor::Pause() {
|
|||||||
Debug(1, "Decoder stopped");
|
Debug(1, "Decoder stopped");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (convert_context) {
|
||||||
|
sws_freeContext(convert_context);
|
||||||
|
convert_context = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
if (analysis_thread) {
|
if (analysis_thread) {
|
||||||
analysis_thread->Stop();
|
analysis_thread->Stop();
|
||||||
Debug(1, "Analysis stopped");
|
Debug(1, "Analysis stopped");
|
||||||
@@ -3472,11 +3477,13 @@ int Monitor::Pause() {
|
|||||||
close_event_thread.join();
|
close_event_thread.join();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (camera) camera->Close();
|
if (camera) {
|
||||||
|
camera->Close();
|
||||||
|
}
|
||||||
|
|
||||||
packetqueue.clear();
|
packetqueue.clear();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
} // end int Monitor::Pause()
|
||||||
|
|
||||||
int Monitor::Play() {
|
int Monitor::Play() {
|
||||||
int ret = camera->PrimeCapture();
|
int ret = camera->PrimeCapture();
|
||||||
@@ -3499,12 +3506,10 @@ int Monitor::Play() {
|
|||||||
Debug(1, "Restarting decoder thread");
|
Debug(1, "Restarting decoder thread");
|
||||||
decoder->Start();
|
decoder->Start();
|
||||||
}
|
}
|
||||||
if (analysing != ANALYSING_NONE) {
|
Debug(1, "Restarting analysis thread");
|
||||||
Debug(1, "Restarting analysis thread");
|
analysis_thread->Start();
|
||||||
analysis_thread->Start();
|
|
||||||
}
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
} // end int Monitor::Play()
|
||||||
|
|
||||||
int Monitor::Close() {
|
int Monitor::Close() {
|
||||||
Pause();
|
Pause();
|
||||||
|
|||||||
Reference in New Issue
Block a user