mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
WebSocketServer: Tiny code cleanup
This commit is contained in:
parent
43e2860709
commit
5ac813b897
@ -156,13 +156,12 @@ static void ObsTickCallback(void *param, float)
|
||||
serialFrameBatch->frameCount++;
|
||||
|
||||
if (serialFrameBatch->sleepUntilFrame) {
|
||||
if (serialFrameBatch->frameCount < serialFrameBatch->sleepUntilFrame) {
|
||||
if (serialFrameBatch->frameCount < serialFrameBatch->sleepUntilFrame)
|
||||
// Do not process any requests if in "sleep mode"
|
||||
return;
|
||||
} else {
|
||||
else
|
||||
// Reset frame sleep until counter if not being used
|
||||
serialFrameBatch->sleepUntilFrame = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Begin recursing any unprocessed requests
|
||||
@ -194,9 +193,8 @@ static void ObsTickCallback(void *param, float)
|
||||
}
|
||||
|
||||
// If request queue is empty, we can notify the paused worker thread
|
||||
if (serialFrameBatch->requests.empty()) {
|
||||
if (serialFrameBatch->requests.empty())
|
||||
serialFrameBatch->condition.notify_one();
|
||||
}
|
||||
}
|
||||
|
||||
void WebSocketServer::ProcessRequestBatch(SessionPtr session, RequestBatchExecutionType::RequestBatchExecutionType executionType, const std::vector<json> &requests, std::vector<json> &results, json &variables, bool haltOnFailure)
|
||||
|
Loading…
Reference in New Issue
Block a user