From dbf465284059aa186c3f4ec91e3d5d172f739b42 Mon Sep 17 00:00:00 2001 From: Lucas Zanella Date: Tue, 27 Jul 2021 14:59:11 -0300 Subject: [PATCH] fixed rtp-info missing for some cameras --- src/client/parse.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/client/parse.rs b/src/client/parse.rs index 9d63f41..b3d2c4c 100644 --- a/src/client/parse.rs +++ b/src/client/parse.rs @@ -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(';');