[FFmpeg-devel] PATCH rtsp/sdp/multicast

Stefano Sabatini stefano.sabatini-lala
Fri Oct 23 10:51:34 CEST 2009


On date Friday 2009-10-23 03:48:37 +0200, armand bendanan encoded:
[...]
> Here is the new corrected patch.

[...]
> diff -Naur old/libavformat/rtsp.c ffmpeg/libavformat/rtsp.c

Maybe it's simpler to use:
svn diff FILES > PATCH

> --- old/libavformat/rtsp.c	2009-10-23 01:41:51.000000000 +0000
> +++ ffmpeg/libavformat/rtsp.c	2009-10-23 01:44:01.000000000 +0000
> @@ -1125,12 +1125,21 @@
>              {
>                  char url[1024];
>                  struct in_addr in;
> +                int port, ttl;
>  
> -                in.s_addr = htonl(reply->transports[0].destination);
> +                if (reply->transports[0].destination != 0) {

'!= 0' is not required, simply use:
if (reply->transports[0].destination) {

> +                    in.s_addr = htonl(reply->transports[0].destination);
> +                    port = reply->transports[0].port_min;
> +                    ttl = reply->transports[0].ttl;

Vertially align like this:

                    in.s_addr = htonl(reply->transports[0].destination);
                    port      = reply->transports[0].port_min;
                    ttl       = reply->transports[0].ttl;

> +                } else {
> +                    // If the destination is not availlable
> +                    // Use rtsp_st->sdp_ip / rtsp_st->sdp_port / rtsp_st->sdp_ttl

I find these comments quite superfluous.

> +                    in = rtsp_st->sdp_ip;
> +                    port = rtsp_st->sdp_port;
> +                    ttl = rtsp_st->sdp_ttl;

Again align the "=".

> +                }
>                  snprintf(url, sizeof(url), "rtp://%s:%d?ttl=%d",
> -                         inet_ntoa(in),
> -                         reply->transports[0].port_min,
> -                         reply->transports[0].ttl);
> +                        inet_ntoa(in), port, ttl);

Weird indent.

>                  if (url_open(&rtsp_st->rtp_handle, url, URL_RDWR) < 0) {
>                      err = AVERROR_INVALIDDATA;
>                      goto fail;
> @@ -1208,6 +1217,12 @@
>              else if (strcmp(option, "tcp") == 0)
>                  lower_transport_mask = (1<< RTSP_LOWER_TRANSPORT_TCP);
>          }
> +        // Suppress the options in the filename
> +        option_list = strchr(s->filename, '?');
> +        if (option_list) {

This may be merged in one line:
           if ((option_list = strchr(s->filename, '?')) {

> +        	*option_list = 0;
> +            dprintf(NULL, "### rtsp_read_header: suppr options:%s\n", s->filename);
> +        }
>      }
>  
>      if (!lower_transport_mask)

Regards, and thanks for the patch.
-- 
FFmpeg = Fiendish and Fierce Monstrous Powered Elitarian Ghost



More information about the ffmpeg-devel mailing list