Fix stats overlay being off by 1 FPS

This commit is contained in:
Cameron Gutman
2020-12-05 20:38:30 -06:00
parent 1ba1ad64ec
commit c301891ff5

View File

@@ -118,7 +118,9 @@ int DrSubmitDecodeUnit(PDECODE_UNIT decodeUnit)
}
else {
// Flip stats roughly every second
if (now - currentVideoStats.startTime > 1.0f) {
if (now - currentVideoStats.startTime >= 1.0f) {
currentVideoStats.endTime = now;
[videoStatsLock lock];
lastVideoStats = currentVideoStats;
[videoStatsLock unlock];
@@ -135,7 +137,6 @@ int DrSubmitDecodeUnit(PDECODE_UNIT decodeUnit)
currentVideoStats.receivedFrames++;
currentVideoStats.totalFrames++;
currentVideoStats.endTime = now;
PLENTRY entry = decodeUnit->bufferList;
while (entry != NULL) {