From d1d2a5c1b55aa726048ba1ed6cab8dbd9ad98f53 Mon Sep 17 00:00:00 2001 From: Srivats P Date: Fri, 21 Apr 2023 17:11:43 +0530 Subject: [PATCH] Fix infinite loop in building interleaved streams Incorrect timestamp comparison was leading to infinite loop --- server/abstractport.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/abstractport.cpp b/server/abstractport.cpp index 5ffbbab..b6adc36 100644 --- a/server/abstractport.cpp +++ b/server/abstractport.cpp @@ -668,7 +668,7 @@ int AbstractPort::updatePacketListInterleaved() sec++; nsec -= long(1e9); } - } while ((sec < durSec) || (nsec < durNsec)); + } while ((sec < durSec) || ((sec == durSec) && (nsec < durNsec))); // XXX: Ideally, for interleaved mode, we have a single packet set and // the set's delay should be 0. @@ -757,7 +757,7 @@ int AbstractPort::updatePacketListInterleaved() sec++; nsec -= long(1e9); } - } while ((sec < durSec) || (nsec < durNsec)); + } while ((sec < durSec) || ((sec == durSec) && (nsec < durNsec))); { qint64 delaySec = durSec - lastPktTxSec;