[FFmpeg-devel] Realmedia patch

Luca Abeni lucabe72
Sat Aug 30 12:30:52 CEST 2008


Hi Ronald,

Ronald S. Bultje wrote:
[...]
> Index: ffmpeg-svn/libavformat/rtsp.c
> ===================================================================
> --- ffmpeg-svn.orig/libavformat/rtsp.c	2008-08-29 21:19:30.000000000 -0400
> +++ ffmpeg-svn/libavformat/rtsp.c	2008-08-29 21:53:09.000000000 -0400
> @@ -32,6 +32,7 @@
>  #include "rtsp.h"
>  
>  #include "rtp_internal.h"
> +#include "rdt.h"
>  
>  //#define DEBUG
>  //#define DEBUG_RTP_TCP
> @@ -870,7 +871,8 @@
>   * @returns 0 on success, <0 on error, 1 if protocol is unavailable.
>   */
>  static int
> -make_setup_request (AVFormatContext *s, const char *host, int port, int protocol)
> +make_setup_request (AVFormatContext *s, const char *host, int port,
> +                    int protocol, const char *real_challenge)
>  {
>      RTSPState *rt = s->priv_data;
>      int j, i, err;
> @@ -918,7 +920,9 @@
>              if (transport[0] != '\0')
>                  av_strlcat(transport, ",", sizeof(transport));
>              snprintf(transport + strlen(transport), sizeof(transport) - strlen(transport) - 1,
> -                     "RTP/AVP/UDP;unicast;client_port=%d-%d",
> +                     "%s;unicast;client_port=%d-%d",

Is "client_port=%d-%d" really needed here, or would "client_port=%d"
be enough? (RDT does not seem to have an RTCP-like companion protocol)


> +                     rt->server_type == RTSP_SERVER_RDT ?
> +                         "x-pn/tng/udp" : "RTP/AVP/UDP",

I am not sure if the "rt->server_type == RTSP_SERVER_RDT ? ..."
construct is a good idea here. It seems to assume that if
server_type != RTSP_SERVER_RDT, then the transport is always
RTP. I'd say that a more explicit "if()" or a "switch" can be
a better idea. But if the maintainer is ok with this, I will
not object.
(this same comment applies to all the "... ? ... : ..."
contructs introduced in this patch.

> Index: ffmpeg-svn/libavformat/rdt.c
> ===================================================================
> --- /dev/null	1970-01-01 00:00:00.000000000 +0000
> +++ ffmpeg-svn/libavformat/rdt.c	2008-08-29 21:25:13.000000000 -0400
> @@ -0,0 +1,71 @@
> +/*
> + * RTP RDT (Realmedia) protocol.
> + * Copyright (c) 2007 Ronald S. Bultje
[...]
> +
> +/**
> + * @file rtp_rm.c

rdt.c


> + * @brief RDT (Realmedia) protocol support
> + * @author Ronald S. Bultje <rbultje at ronald.bitfreak.net>
> + */
> +
> +#include "avformat.h"
> +#include "libavutil/avstring.h"
> +#include "rtp_internal.h"

This should probably be rdt.h


				Luca




More information about the ffmpeg-devel mailing list