rtsp: Specify unicast for TCP interleaved streams, too

Message ID 1300710390-65405-1-git-send-email-martin@martin.st
State Superseded
Headers show

Commit Message

Martin Storsjö March 21, 2011, 12:26 p.m.
According to the RFC, the default is multicast if nothing is
specified, which doesn't make sense for TCP.

According to a bug report, some Axis camera models give a
"400 Bad Request" error if this is omitted.
---
Tested on DSS, and this patch works just fine there. Is there
any other RTSP server which doesn't work if this is present, or
was the reason for only including it for WMS only that
it was the only one really requiring it, up until now?

 libavformat/rtsp.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

Comments

Diego Elio Pettenò March 21, 2011, 12:27 p.m. | #1
Il giorno lun, 21/03/2011 alle 14.26 +0200, Martin Storsjö ha scritto:
> 
> According to the RFC, the default is multicast if nothing is
> specified, which doesn't make sense for TCP. 

LGTM [And for once it's something I do know about :P]
Ronald Bultje March 21, 2011, 12:49 p.m. | #2
Hi,

On Mon, Mar 21, 2011 at 8:26 AM, Martin Storsjö <martin@martin.st> wrote:
> According to the RFC, the default is multicast if nothing is
> specified, which doesn't make sense for TCP.
>
> According to a bug report, some Axis camera models give a
> "400 Bad Request" error if this is omitted.
> ---
> Tested on DSS, and this patch works just fine there. Is there
> any other RTSP server which doesn't work if this is present, or
> was the reason for only including it for WMS only that
> it was the only one really requiring it, up until now?
>
>  libavformat/rtsp.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
> index 6d538cd..ddc7e23 100644
> --- a/libavformat/rtsp.c
> +++ b/libavformat/rtsp.c
> @@ -1157,8 +1157,7 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
>                 continue;
>             snprintf(transport, sizeof(transport) - 1,
>                      "%s/TCP;", trans_pref);
> -            if (rt->server_type == RTSP_SERVER_WMS)
> -                av_strlcat(transport, "unicast;", sizeof(transport));
> +            av_strlcat(transport, "unicast;", sizeof(transport));

Please test this on Real servers, I remember this causing problems there.

Ronald

Patch

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 6d538cd..ddc7e23 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1157,8 +1157,7 @@  int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
                 continue;
             snprintf(transport, sizeof(transport) - 1,
                      "%s/TCP;", trans_pref);
-            if (rt->server_type == RTSP_SERVER_WMS)
-                av_strlcat(transport, "unicast;", sizeof(transport));
+            av_strlcat(transport, "unicast;", sizeof(transport));
             av_strlcatf(transport, sizeof(transport),
                         "interleaved=%d-%d",
                         interleave, interleave + 1);