webrtc-sdp icon indicating copy to clipboard operation
webrtc-sdp copied to clipboard

parse_media not covering valid fmt's

Open ghost opened this issue 4 years ago • 3 comments

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

ghost avatar Mar 09 '21 16:03 ghost

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

mjfroman avatar Mar 09 '21 18:03 mjfroman

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?

nils-ohlmeier avatar Mar 09 '21 18:03 nils-ohlmeier

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

na-g avatar Jul 26 '21 23:07 na-g