Merge pull request #65 from osery/osery/ingore-rtcp
Skip RTCP packets when these are multiplexed on the same port.
This commit is contained in:
commit
030575e585
@ -38,8 +38,11 @@ const (
|
||||
)
|
||||
|
||||
const (
|
||||
RTPHeaderSize = 12
|
||||
RTPHeaderSize = 12
|
||||
RTCPSenderReport = 200
|
||||
RTCPReceiverReport = 201
|
||||
)
|
||||
|
||||
const (
|
||||
DESCRIBE = "DESCRIBE"
|
||||
OPTIONS = "OPTIONS"
|
||||
@ -558,6 +561,11 @@ func (client *RTSPClient) RTPDemuxer(payloadRAW *[]byte) ([]*av.Packet, bool) {
|
||||
SequenceNumber := int(binary.BigEndian.Uint16(content[6:8]))
|
||||
timestamp := int64(binary.BigEndian.Uint32(content[8:16]))
|
||||
|
||||
if isRTCPPacket(content) {
|
||||
client.Println("skipping RTCP packet")
|
||||
return nil, false
|
||||
}
|
||||
|
||||
offset := RTPHeaderSize
|
||||
|
||||
end := len(content)
|
||||
@ -950,3 +958,8 @@ func binSize(val int) []byte {
|
||||
binary.BigEndian.PutUint32(buf, uint32(val))
|
||||
return buf
|
||||
}
|
||||
|
||||
func isRTCPPacket(content []byte) bool {
|
||||
rtcpPacketType := content[5]
|
||||
return rtcpPacketType == RTCPSenderReport || rtcpPacketType == RTCPReceiverReport
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user