Skip to content

Commit

Permalink
Explicitly reject unsupported m= lines
Browse files Browse the repository at this point in the history
CreateAnswer currently omits any m= lines from the offer that contain
unsupported codecs. The jsep spec says that unsupported lines in the
offer need to be explicitly rejected by setting the port number to 0.

Related to #449
  • Loading branch information
maxhawkins committed Feb 27, 2019
1 parent 5817e72 commit b02d8ee
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions peerconnection.go
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,14 @@ func (pc *PeerConnection) addFingerprint(d *sdp.SessionDescription) {

func (pc *PeerConnection) addRTPMediaSection(d *sdp.SessionDescription, codecType RTPCodecType, midValue string, iceParams ICEParameters, peerDirection RTPTransceiverDirection, candidates []ICECandidate, dtlsRole sdp.ConnectionRole) bool {
if codecs := pc.api.mediaEngine.getCodecsByKind(codecType); len(codecs) == 0 {
d.WithMedia(&sdp.MediaDescription{
MediaName: sdp.MediaName{
Media: codecType.String(),
Port: sdp.RangedPort{Value: 0},
Protos: []string{"UDP", "TLS", "RTP", "SAVPF"},
Formats: []string{"0"},
},
})
return false
}
media := sdp.NewJSEPMediaDescription(codecType.String(), []string{}).
Expand Down

0 comments on commit b02d8ee

Please sign in to comment.