From 1c321bfccc7178c491fb8a742d3e7bbee5cec542 Mon Sep 17 00:00:00 2001 From: Raja Subramanian Date: Wed, 1 Feb 2023 12:41:07 +0530 Subject: [PATCH] Ignore inactive media. (#1365) * Ignore inactive media. Seeing some errors of "track info not published prior to track". Happens when trying to configure publisher answer for audio for DTX and stereo and trying to find a pending track. There are cases where there are inactive m-lines in SDP that is hitting this. * fix sense --- pkg/rtc/participant_sdp.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/rtc/participant_sdp.go b/pkg/rtc/participant_sdp.go index a37e650f2..6ae4b8715 100644 --- a/pkg/rtc/participant_sdp.go +++ b/pkg/rtc/participant_sdp.go @@ -191,6 +191,10 @@ func (p *ParticipantImpl) configurePublisherAnswer(answer webrtc.SessionDescript for _, m := range parsed.MediaDescriptions { switch m.MediaName.Media { case "audio": + _, ok := m.Attribute(sdp.AttrKeyInactive) + if ok { + continue + } mid, ok := m.Attribute(sdp.AttrKeyMID) if !ok { continue @@ -198,6 +202,10 @@ func (p *ParticipantImpl) configurePublisherAnswer(answer webrtc.SessionDescript // find track info from offer's stream id var ti *livekit.TrackInfo for _, om := range parsedOffer.MediaDescriptions { + _, ok := om.Attribute(sdp.AttrKeyInactive) + if ok { + continue + } omid, ok := om.Attribute(sdp.AttrKeyMID) if ok && omid == mid { streamID, ok := lksdp.ExtractStreamID(om)