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.
This commit is contained in:
Michael Fabian 'Xaymar' Dirks
2017-10-28 03:14:26 +02:00
parent 658063ea41
commit 1872f7c000
+1 -1
View File
@@ -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