Skip to content

Commit abd6a35

Browse files
wdouglassSean-Der
authored andcommitted
Create data media sections for each requested
Don't create data media sections unless we're asked to Fixes #1349
1 parent 940d6aa commit abd6a35

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

peerconnection.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1856,7 +1856,9 @@ func (pc *PeerConnection) generateUnmatchedSDP(useIdentity bool) (*sdp.SessionDe
18561856
if len(audio) > 0 {
18571857
mediaSections = append(mediaSections, mediaSection{id: "audio", transceivers: audio})
18581858
}
1859-
mediaSections = append(mediaSections, mediaSection{id: "data", data: true})
1859+
for i := uint32(0); i < pc.sctpTransport.dataChannelsRequested; i++ {
1860+
mediaSections = append(mediaSections, mediaSection{id: pc.sctpTransport.dataChannels[i].label, data: true})
1861+
}
18601862
} else {
18611863
for _, t := range pc.GetTransceivers() {
18621864
if t.Sender() != nil {
@@ -1865,7 +1867,9 @@ func (pc *PeerConnection) generateUnmatchedSDP(useIdentity bool) (*sdp.SessionDe
18651867
mediaSections = append(mediaSections, mediaSection{id: t.Mid(), transceivers: []*RTPTransceiver{t}})
18661868
}
18671869

1868-
mediaSections = append(mediaSections, mediaSection{id: strconv.Itoa(len(mediaSections)), data: true})
1870+
for i := uint32(0); i < pc.sctpTransport.dataChannelsRequested; i++ {
1871+
mediaSections = append(mediaSections, mediaSection{id: strconv.Itoa(len(mediaSections)), data: true})
1872+
}
18691873
}
18701874

18711875
dtlsFingerprints, err := pc.configuration.Certificates[0].GetFingerprints()

0 commit comments

Comments
 (0)