Add quque clean
This commit is contained in:
parent
feb71f62ab
commit
7fb25692da
@ -299,6 +299,7 @@ func (client *RTSPClient) appendAudioPacket(retmap []*av.Packet, nal []byte, dur
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (client *RTSPClient) appendVideoPacket(retmap []*av.Packet, nal []byte, isKeyFrame bool) []*av.Packet {
|
func (client *RTSPClient) appendVideoPacket(retmap []*av.Packet, nal []byte, isKeyFrame bool) []*av.Packet {
|
||||||
|
var realVideoMs int64
|
||||||
duration := time.Duration(float32(client.timestamp-client.PreVideoTS)/TimeBaseFactor) * time.Millisecond
|
duration := time.Duration(float32(client.timestamp-client.PreVideoTS)/TimeBaseFactor) * time.Millisecond
|
||||||
sdpDuration := client.durationFromSDP()
|
sdpDuration := client.durationFromSDP()
|
||||||
if sdpDuration != 0 && duration > sdpDuration {
|
if sdpDuration != 0 && duration > sdpDuration {
|
||||||
@ -314,9 +315,11 @@ func (client *RTSPClient) appendVideoPacket(retmap []*av.Packet, nal []byte, isK
|
|||||||
} else {
|
} else {
|
||||||
client.keyFrameIterateDrua += duration.Milliseconds()
|
client.keyFrameIterateDrua += duration.Milliseconds()
|
||||||
}
|
}
|
||||||
realVideoMs := client.keyFrameRealVideoTs * 1000
|
if client.realVideoTs != 0 {
|
||||||
|
realVideoMs = client.keyFrameRealVideoTs * 1000
|
||||||
realVideoMs += client.keyFrameIterateDrua
|
realVideoMs += client.keyFrameIterateDrua
|
||||||
|
}
|
||||||
|
|
||||||
return append(retmap, &av.Packet{
|
return append(retmap, &av.Packet{
|
||||||
Data: append(binSize(len(nal)), nal...),
|
Data: append(binSize(len(nal)), nal...),
|
||||||
CompositionTime: time.Duration(TimeDelay) * time.Millisecond,
|
CompositionTime: time.Duration(TimeDelay) * time.Millisecond,
|
||||||
|
Loading…
Reference in New Issue
Block a user