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

Fixed bug in rtsp streaming caused by a signed - unsigned conversion. #555

Merged
merged 1 commit into from Nov 5, 2014

Conversation

manupap1
Copy link
Contributor

@manupap1 manupap1 commented Nov 5, 2014

This patch solves a streaming issue with one of my AXIS encoders which sends SDES packets on the RTSP control stream.
In some case the value of contentLen can be badly reinterpreted and this may lead to a nearly infinit loop.

@connortechnology
Copy link
Member

OOoh neat. Thanks for this.

@connortechnology
Copy link
Member

Wow, those lines calculating paddedLen offend me. Useless adds and subtracts. Do you understand the values and calcs that are being done? Can you document them, and merge those two lines that calculate paddedLen and get rid of anything useless? I know the add and sub are only nanoseconds but really... a good documenting line help a lot.

connortechnology added a commit that referenced this pull request Nov 5, 2014
Fixed bug in rtsp streaming caused by a signed - unsigned conversion.

I like it. but please... somehelp help out with my comments above.
@connortechnology connortechnology merged commit 91986f3 into ZoneMinder:master Nov 5, 2014
@knight-of-ni knight-of-ni added this to the 1.28.1 milestone Nov 5, 2014
@manupap1
Copy link
Contributor Author

manupap1 commented Nov 5, 2014

I am not a specialist in RSTP streaming, I can't help you efficiently about the documentation,
I tracked this bug because I am testing some modified code which consists in inplementing a plugin management feature based on nextime work.

@sogood007
Copy link

                 paddedLen = (((paddedLen-1)/4)+1)*4;

Is the question about this code? It seems to me it is to roundup to the nearest multiple by 4 number. Usually, I will code in this way instead
x = (x + (n - 1) ) / (n) * n ; // to round to the nearest multiple of n
The reason for the division and multiple is to take advantage of the integer division which will drop of the remainder. The pre addition of (n-1) is to account for the integer division so as the final effect of rounding up.

@connortechnology
Copy link
Member

That makes sense. I will just add a comment saying so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants