[FFmpeg-devel] [PATCH] RTSP alternate protocol 2-3/3

Ronald S. Bultje rsbultje
Thu Feb 14 15:01:00 CET 2008


Hi,

On Mon, Feb 11, 2008 at 3:39 AM, Benoit Fouet <benoit.fouet at purplelabs.com>
wrote:

> Ronald S. Bultje wrote:
> > Index: ffmpeg/libavformat/rtsp.c
> > ===================================================================
> > --- ffmpeg.orig/libavformat/rtsp.c    2008-02-09 10:03:20.000000000-0500
> > +++ ffmpeg/libavformat/rtsp.c 2008-02-09 10:06:39.000000000 -0500
> > @@ -870,7 +870,7 @@
> >          transport[0] = '\0';
> >
> >          /* RTP/UDP */
> > -        if (protocol & (1 << RTSP_PROTOCOL_RTP_UDP)) {
> > +     if (protocol == RTSP_PROTOCOL_RTP_UDP) {
> >
>
> unrelated


This, together with the protocol_mask -> protocol, is now in a separate
patch (3/4, coming in a separate thread).


> > @@ -1080,9 +1084,18 @@
> >          goto fail;
> >      }
> >
> > -    err = make_setup_request(s, host, port, protocol_mask);
> > -    if (err)
> > -        goto fail;
> > +    do {
> > +        int protocol = ff_log2_tab[protocol_mask & ~(protocol_mask -
> 1)];
> > +
> > +        err = make_setup_request(s, host, port, protocol);
> > +        if (err < 0)
> > +            goto fail;
> >
>
> cosmetics, and why have you changed the check ? was there something
> wrong with it ?


Change was explained previously, an cosmetics are fixed and moved to the
reindent patch.


> > +        protocol_mask &= ~(1 << protocol);
> > +        if (protocol_mask == 0 && err == 1) {
> > +            err = AVERROR_INVALIDDATA;
> > +            goto fail;
> > +        }
> > +    } while (err != 0);
> >
>
> IIRC, while (!err) is prefered


Fixed.


> > Index: ffmpeg/libavformat/rtsp.h
> > ===================================================================
> > --- ffmpeg.orig/libavformat/rtsp.h    2008-02-09 10:02:35.000000000-0500
> > +++ ffmpeg/libavformat/rtsp.h 2008-02-09 10:03:25.000000000 -0500
> > @@ -29,6 +29,8 @@
> >      RTSP_PROTOCOL_RTP_UDP = 0,
> >      RTSP_PROTOCOL_RTP_TCP = 1,
> >      RTSP_PROTOCOL_RTP_UDP_MULTICAST = 2,
> > +    /**< This is not part of public API and shouldn't be used outside
> of ffmpeg */
> > +    RTSP_PROTOCOL_RTP_LAST
> >
>
> doxy comment prefix should be /**, not /**<


Fixed.

New patch (2/4) attached.

Ronald
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: rtsp-alternate-protocol.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080214/54574ae3/attachment.txt>



More information about the ffmpeg-devel mailing list