From c6529706436ca758cbaba8ef5f56178fb93cd43f Mon Sep 17 00:00:00 2001 From: deepch Date: Wed, 9 Mar 2022 19:34:30 +0300 Subject: [PATCH] fix negative dur --- format/rtspv2/client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/format/rtspv2/client.go b/format/rtspv2/client.go index 4cee103..d32e207 100644 --- a/format/rtspv2/client.go +++ b/format/rtspv2/client.go @@ -587,7 +587,8 @@ func (client *RTSPClient) RTPDemuxer(payloadRAW *[]byte) ([]*av.Packet, bool) { if timestamp-client.PreVideoTS < 0 { //var ui32 uint64 = math.MaxUint32 if math.MaxUint32-client.PreVideoTS < 90*100 { //100 ms - client.PreVideoTS = math.MaxUint32 - client.PreVideoTS + client.PreVideoTS = 0 + client.PreVideoTS -= (math.MaxUint32 - client.PreVideoTS) } else { client.PreVideoTS = 0 }