Revert "Remove sleeping from Analysis thread. It is uneccessary and results in us starting off way behind the capture thread. It also limits us to 30fps."
This reverts commit 6c4156a483
.
This commit is contained in:
parent
aaaf87abdb
commit
cd6c44db47
|
@ -23,6 +23,14 @@ void AnalysisThread::Start() {
|
||||||
|
|
||||||
void AnalysisThread::Run() {
|
void AnalysisThread::Run() {
|
||||||
while (!(terminate_ or zm_terminate)) {
|
while (!(terminate_ or zm_terminate)) {
|
||||||
monitor_->Analyse();
|
// Some periodic updates are required for variable capturing framerate
|
||||||
|
Debug(2, "Analyzing");
|
||||||
|
if (!monitor_->Analyse()) {
|
||||||
|
if (!(terminate_ or zm_terminate)) {
|
||||||
|
Microseconds sleep_for = monitor_->Active() ? Microseconds(ZM_SAMPLE_RATE) : Microseconds(ZM_SUSPENDED_RATE);
|
||||||
|
Debug(2, "Sleeping for %" PRId64 "us", int64(sleep_for.count()));
|
||||||
|
std::this_thread::sleep_for(sleep_for);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue