fixed rtp-info missing for some cameras

This commit is contained in:
Lucas Zanella 2021-07-27 14:59:11 -03:00 committed by Scott Lamb
parent 9a6e418ea3
commit dbf4652840

View File

@ -498,9 +498,11 @@ pub(crate) fn parse_play(
presentation: &mut Presentation,
) -> Result<(), String> {
// https://tools.ietf.org/html/rfc2326#section-12.33
let rtp_info = response
.header(&rtsp_types::headers::RTP_INFO)
.ok_or_else(|| "PLAY response has no RTP-Info header".to_string())?;
let rtp_info = match response
.header(&rtsp_types::headers::RTP_INFO) {
Some(rtsp_info) => rtsp_info,
None => return Ok(())
};
for s in rtp_info.as_str().split(',') {
let s = s.trim();
let mut parts = s.split(';');