From 1872f7c000d7477dad21570bc0da8f191957fb35 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 28 Oct 2017 03:14:26 +0200 Subject: [PATCH] Fix time limit calculation being the wrong way around. This caused the code to wait for up to x seconds, where x is the Num/Den FPS time. The correct way is Den/Num, so that it only waits a single frame. --- Source/enc-vfw.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/enc-vfw.cpp b/Source/enc-vfw.cpp index 9dd85b0..bcfa1e4 100644 --- a/Source/enc-vfw.cpp +++ b/Source/enc-vfw.cpp @@ -554,7 +554,7 @@ bool VFW::Encoder::encode(struct encoder_frame *frame, struct encoder_packet *pa using schrc = std::chrono::high_resolution_clock; bool submittedFrame = false; - long long maxTime = size_t((double_t(m_fpsNum) / double_t(m_fpsDen)) * 1000000000); + long long maxTime = size_t((double_t(m_fpsDen) / double_t(m_fpsNum)) * 1000000000ll); while (((*received_packet == false) || (submittedFrame == false)) && (sc::nanoseconds((schrc::now() - tbegin)).count() < maxTime)) { // Submit frame to PreProcessor