Skip padding packet for simulcast probe

Skip padding packet for simulcast probe
Fix rtx attributes panic for nil map
This commit is contained in:
cnderrauber
2024-02-02 09:36:40 +08:00
committed by David Zhao
parent c259e89eb5
commit dae5e8e1a0
4 changed files with 37 additions and 4 deletions

View File

@@ -266,12 +266,16 @@ func satisfyTypeAndDirection(remoteKind RTPCodecType, remoteDirection RTPTransce
// handleUnknownRTPPacket consumes a single RTP Packet and returns information that is helpful
// for demuxing and handling an unknown SSRC (usually for Simulcast)
func handleUnknownRTPPacket(buf []byte, midExtensionID, streamIDExtensionID, repairStreamIDExtensionID uint8, mid, rid, rsid *string) (payloadType PayloadType, err error) {
func handleUnknownRTPPacket(buf []byte, midExtensionID, streamIDExtensionID, repairStreamIDExtensionID uint8, mid, rid, rsid *string) (payloadType PayloadType, paddingOnly bool, err error) {
rp := &rtp.Packet{}
if err = rp.Unmarshal(buf); err != nil {
return
}
if rp.Padding && len(rp.Payload) == 0 {
paddingOnly = true
}
if !rp.Header.Extension {
return
}