shinyoshiaki / werift-webrtc

WebRTC Implementation for TypeScript (Node.js), includes ICE/DTLS/SCTP/RTP/SRTP/WEBM/MP4

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SDP validation fails if mid values do not match

koush opened this issue · comments

throw new Error("Media sections in answer do not match offer");

Offer: Werift (mid: 0_srtp)
Answer: Google Camera Gen 2 (mid: 0)

Werift generates mid values that do not match the answer sdp (suffixed with strip). This causes the above failure. This is new behavior in this change:
32a3610#r77415945

For now, I am manually setting the mid values to to force a match (only because I know what the answer sdp will be ahead of time).
I believe the above matching code is incorrect, it should likely do a comparison against mLineIndex.

I'm wondering why "Google Camera Gen 2" does that since many implementations copy mid as contained in Offer. For now, I'll change it to check mLineIndex instead of Mid.

I'm wondering why "Google Camera Gen 2" does that since many implementations copy mid as contained in Offer. For now, I'll change it to check mLineIndex instead of Mid.

Yes, this could be a google bug. I do think that plain numeric mid values as the default (which was my workaround) should be the preferred behavior as that is how most implementations behave, and unfortunately expect. If a user wants to use custom value they can do that.