Skip to content

Commit

Permalink
Support MP2T proto
Browse files Browse the repository at this point in the history
  • Loading branch information
yujincheng08 committed Feb 14, 2024
1 parent acd8fc4 commit d8bba93
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/client/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,12 @@ fn parse_media(base_url: &Url, media_description: &Media) -> Result<Stream, Stri
// https://www.iana.org/assignments/sdp-parameters/sdp-parameters.xhtml#sdp-parameters-2
// shows several other variants, such as "TCP/RTP/AVP". Looking for a "RTP" component
// seems appropriate.
if !media_description.proto.starts_with("RTP/") && !media_description.proto.contains("/RTP/") {
// https://www.ietf.org/archive/id/draft-sheedy-mmusic-rtsp-ext-01.txt
// adds "MP2T" as a valid proto which is used by some ISPs.
if !media_description.proto.starts_with("RTP/")
&& !media_description.proto.contains("/RTP/")
&& !media_description.proto.contains("MP2T/")
{
return Err("Expected RTP-based proto".into());
}

Expand Down

0 comments on commit d8bba93

Please sign in to comment.