ZoneMinder/ZoneMinder — pull request #557 by manupap1 (2014-11-06 10:09:17+00:00)
Title: Fixed bug in rtsp streaming caused by a bad string concatenation

This patch solves a RTSP streaming issue if the SDP descriptor provides an absolute URL for the "a=control" attribute.

Section C.1.1 of RFC2326 (http://tools.ietf.org/html/rfc2326#page-80) says that the "a=control" may contain either relative and absolute URLs.

ZM always considers the control URL as relative and appends it to the base URL which may result in bad RTSP SETUP commands.

Example : SETUP rtsp://192.168.1.1:8080/test.sdp/rtsp://192.168.1.1:8080/test.sdp/trackID=0 RTSP/1.0

This bug can be reproduced by using the VLC streaming capabilities as a RTSP input.

I added an instruction to check if the control URL starts with the base URL, which means that the URL is absolute and we don't have to concatenate.