From 5a2cb78219168af7a0f446cd97dbac2d3c1868e6 Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Fri, 12 Oct 2012 11:10:09 +0300 Subject: rtspdec: Set the default port for listen mode, if none is specified MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Storsjö --- libavformat/rtspdec.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libavformat/rtspdec.c') diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c index d46f1a4872..7e7fb2dcfd 100644 --- a/libavformat/rtspdec.c +++ b/libavformat/rtspdec.c @@ -621,6 +621,10 @@ static int rtsp_listen(AVFormatContext *s) /* ff_url_join. No authorization by now (NULL) */ ff_url_join(rt->control_uri, sizeof(rt->control_uri), "rtsp", NULL, host, port, "%s", path); + + if (port < 0) + port = RTSP_DEFAULT_PORT; + /* Create TCP connection */ ff_url_join(tcpname, sizeof(tcpname), "tcp", NULL, host, port, "?listen&listen_timeout=%d", rt->initial_timeout * 1000); -- cgit v1.2.3