-
Notifications
You must be signed in to change notification settings - Fork 4
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
Expand length verification #37
Conversation
Hi @Noarkhh When sending a play request using the same session for rtp data. Some IP cameras send an RTSP response along an RTP packet on one network packet which causes the function above to loop forever. |
Hi @gBillal I think when this function was written it was assumed that the only traffic on the TCP connection would be RTSP communication. In my experience with RTP over TCP with RTSP some servers start streaming and send some RTCP and RTP packets even before the response to PLAY request. I think the best solution to this is to use Purpose of this PR was essentially to expand the verification to include cases, where there is no Content-Length header, but there was more data anyway. I needed it specifically for membraneframework/membrane_rtp_plugin#166, so that capturing RTSP responses in cases of interleaved RTP would work correctly. By the way I was getting ready to start implementing a RTSP Source and creating |
Using For |
lib/membrane_rtsp/response.ex
Outdated
@@ -128,7 +129,7 @@ defmodule Membrane.RTSP.Response do | |||
if byte_size(body) == 0 do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw, can you change this if
to when
(a guard), to reduce nesting?
Make verify_content_length recognize and inform if body length is too long