mozilla / webrtc-sdp

Rust SDP parser for WebRTC
Mozilla Public License 2.0
155 stars 30 forks source link

parse_media not covering valid fmt's #248

Open q6r opened 3 years ago

q6r commented 3 years ago

https://github.com/mozilla/webrtc-sdp/blob/6d7b7d512c012a7d3f8ba4463423c7b172e0136c/src/media_type.rs#L378

Fails for

Line { error: Generic("format number in media line is out of range"), line: "m=audio 30000 RTP/AVP 0 8 97 2 3", line_number: 5 }

2 is ITU-T G.721 3 is GSM 06.10 from https://tools.ietf.org/html/rfc1890 there's a list of all PTs.

This may not be in the scope of the crate because of aimed to handle WebRTC SDP offers and answers

mjfroman commented 3 years ago

One key here is that rfc1890 has been obsoleted by rfc3551. PT 2 is reserved - see section 6

nils-ohlmeier commented 3 years ago

I think this raises a good point. The parser itself should probably parse any known codecs and leave it up to application if it wants to handle these PTs. @na-g any thoughts on this from your side?

na-g commented 3 years ago

@nils-ohlmeier I would rather keep it constrained to what WebRTC offers unless there is a very convincing use case.