[FFmpeg-devel] PATCH rtsp/sdp/multicast
armand bendanan
armand.bendanan
Fri Oct 23 14:33:35 CEST 2009
> -----Original Message-----
> From: ffmpeg-devel-bounces at mplayerhq.hu [mailto:ffmpeg-devel-
> bounces at mplayerhq.hu] On Behalf Of Stefano Sabatini
> Sent: vendredi 23 octobre 2009 10:52
> To: FFmpeg development discussions and patches
> Subject: Re: [FFmpeg-devel] PATCH rtsp/sdp/multicast
>
> 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
Thank for this svn command ! I didn't know that.
>
> > --- 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.
I send a new version of the patch as a reply to Diego message.
__________ Information from ESET NOD32 Antivirus, version of virus signature
database 4536 (20091023) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
More information about the ffmpeg-devel
mailing list