diff --git a/sdp.go b/sdp.go index ce0764153e2..0219d85cc3b 100644 --- a/sdp.go +++ b/sdp.go @@ -820,10 +820,7 @@ func codecsFromMediaDescription(m *sdp.MediaDescription) (out []RTPCodecParamete codec, err := s.GetCodecForPayloadType(uint8(payloadType)) if err != nil { - if payloadType == 0 { - continue - } - return nil, err + continue } channels := uint16(0) @@ -848,6 +845,9 @@ func codecsFromMediaDescription(m *sdp.MediaDescription) (out []RTPCodecParamete PayloadType: PayloadType(payloadType), }) } + if out == nil { + return nil, fmt.Errorf("no valid codecs found") + } return out, nil }