Skip to content

Commit

Permalink
Add missing a=ssrc lines for RTX/FEC
Browse files Browse the repository at this point in the history
Pion extracts them from ssrc-group line so this didn't failed
Pion<->Pion. Chrome/FireFox uses the dedicated a=ssrc lines and our
Offer/Answer would break negotation

Fixes #2922
  • Loading branch information
Sean-Der committed Oct 7, 2024
1 parent 9d6c27f commit 64f32d2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion sdp.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ func populateLocalCandidates(sessionDescription *SessionDescription, i *ICEGathe
}
}

// nolint: gocognit
func addSenderSDP(
mediaSection mediaSection,
isPlanB bool,
Expand All @@ -395,14 +396,20 @@ func addSenderSDP(
if encoding.RTX.SSRC != 0 {
media = media.WithValueAttribute("ssrc-group", fmt.Sprintf("FID %d %d", encoding.SSRC, encoding.RTX.SSRC))
}

if encoding.FEC.SSRC != 0 {
media = media.WithValueAttribute("ssrc-group", fmt.Sprintf("FEC-FR %d %d", encoding.SSRC, encoding.FEC.SSRC))
}

media = media.WithMediaSource(uint32(encoding.SSRC), track.StreamID() /* cname */, track.StreamID() /* streamLabel */, track.ID())

if !isPlanB {
if encoding.RTX.SSRC != 0 {
media = media.WithMediaSource(uint32(encoding.RTX.SSRC), track.StreamID() /* cname */, track.StreamID() /* streamLabel */, track.ID())
}
if encoding.FEC.SSRC != 0 {
media = media.WithMediaSource(uint32(encoding.FEC.SSRC), track.StreamID() /* cname */, track.StreamID() /* streamLabel */, track.ID())
}

media = media.WithPropertyAttribute("msid:" + track.StreamID() + " " + track.ID())
}
}
Expand Down

0 comments on commit 64f32d2

Please sign in to comment.