From 8ae08ddb1e3efe86ac47c256b54499fceac66463 Mon Sep 17 00:00:00 2001 From: Craig Moksnes Date: Sun, 15 Mar 2020 16:26:33 -0500 Subject: [PATCH] Monitor packet size --- SocketUtils.pas | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SocketUtils.pas b/SocketUtils.pas index 1085cc9..bfdfae8 100644 --- a/SocketUtils.pas +++ b/SocketUtils.pas @@ -117,7 +117,7 @@ TRTPVideoSink = class(TInterfacedObject, IRTPVideoSink) private fStats: IVideoStats; fServer: TIdUDPServer; - fLargestPacket: Int64; + fLastPacketSize: Int64; fClosed: Boolean; fWriteEvent: TEvent; @@ -508,10 +508,10 @@ procedure TRTPVideoSink.UDPRead(AThread: TIdUDPListenerThread; if AThread.Priority <> tpHigher then AThread.Priority := tpHigher; - if Length(AData) > fLargestPacket then + if Length(AData) <> fLastPacketSize then begin - fLargestPacket := Length(AData); - TLogger.LogFmt(cLogDefault, 'Largest packet: %d', [fLargestPacket]); + fLastPacketSize := Length(AData); + TLogger.LogFmt(cLogDefault, 'New packet size: %d', [fLastPacketSize]); end; lHeader := @AData[0];