Skip to content

Commit

Permalink
Monitor packet size
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig Moksnes committed Mar 15, 2020
1 parent 485adeb commit 8ae08dd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions SocketUtils.pas
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ TRTPVideoSink = class(TInterfacedObject, IRTPVideoSink)
private
fStats: IVideoStats;
fServer: TIdUDPServer;
fLargestPacket: Int64;
fLastPacketSize: Int64;
fClosed: Boolean;
fWriteEvent: TEvent;

Expand Down Expand Up @@ -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];
Expand Down

0 comments on commit 8ae08dd

Please sign in to comment.