Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RTSP parsing #2190

Merged
merged 3 commits into from
Jun 2, 2020
Merged

Conversation

lionelnicolas
Copy link
Contributor

This fixes two issues in streaming plugin when pulling an RTSP stream.

When the RTSP server is not sending fmtp in its SDP, values returned to browsers are wrong because of uninitialized variables :

a=fmtp:111 ���\�

When the RTSP server is sending a incomplete fmtp line, fmtp parameters where taken from the following line.

For example, if RTSP server sends :

(...)
a=fmtp:98
a=control:streamid=0
(...)

The streaming plugin was sending to the browser :

a=fmtp:98 a=control:streamid=0

if(mp->codecs.video_fmtp == NULL)
mp->codecs.video_fmtp = dovideo ? g_strdup(vfmtp) : NULL;
mp->codecs.video_fmtp = dovideo && strlen(vfmtp) ? g_strdup(vfmtp) : NULL;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just as a matter of readability, please group the condition in brackets in the 4 lines above.

@lminiero
Copy link
Member

lminiero commented Jun 2, 2020

Thanks! I just added a small note, and then it's good to merge for me.

This ensures that only spaces could be present between format number and
format parameters.
This ensures that only spaces could be present between PT and encoding
name.
@lminiero
Copy link
Member

lminiero commented Jun 2, 2020

Thanks, merging 👍

@lminiero lminiero merged commit af8a082 into meetecho:master Jun 2, 2020
@lionelnicolas lionelnicolas deleted the bugfix/rtsp-sdp-parsing branch June 2, 2020 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants