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:
+1
-1
@@ -554,7 +554,7 @@ bool VFW::Encoder::encode(struct encoder_frame *frame, struct encoder_packet *pa
|
|||||||
using schrc = std::chrono::high_resolution_clock;
|
using schrc = std::chrono::high_resolution_clock;
|
||||||
|
|
||||||
bool submittedFrame = false;
|
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))
|
while (((*received_packet == false) || (submittedFrame == false))
|
||||||
&& (sc::nanoseconds((schrc::now() - tbegin)).count() < maxTime)) {
|
&& (sc::nanoseconds((schrc::now() - tbegin)).count() < maxTime)) {
|
||||||
// Submit frame to PreProcessor
|
// Submit frame to PreProcessor
|
||||||
|
|||||||
Reference in New Issue
Block a user