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

Michael Niedermayer michaelni
Wed Mar 19 04:06:52 CET 2008


On Tue, Mar 18, 2008 at 10:45:54PM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> On Tue, Mar 18, 2008 at 10:29 PM, Michael Niedermayer <michaelni at gmx.at>
> wrote:
> 
> > rtsp_st is the wrong thing to use anyway, rt->rtsp_streams looks better
> 
> 
> I guess for closing the several streams that could have been opened, yeah...
> How about the attached? Simpler and more correct.
> 
> Ronald

> Index: ffmpeg/libavformat/rtsp.c
> ===================================================================
> --- ffmpeg.orig/libavformat/rtsp.c	2008-02-14 08:52:00.000000000 -0500
> +++ ffmpeg/libavformat/rtsp.c	2008-03-18 22:43:09.000000000 -0400
> @@ -920,6 +920,10 @@
>                   "Transport: %s\r\n",
>                   rtsp_st->control_url, transport);
>          rtsp_send_cmd(s, cmd, reply, NULL);
> +        if (reply->status_code == 461 /* Unsupported protocol */ && i == 0) {
> +            err = 1;
> +            goto fail;
> +        } else
>          if (reply->status_code != RTSP_STATUS_OK ||
>              reply->nb_transports != 1) {
>              err = AVERROR_INVALIDDATA;
> @@ -1001,6 +1005,10 @@
>      return 0;
>  
>  fail:
> +    while (i-- > 0) {
> +        url_close(rt->rtsp_streams[i]->rtp_handle);
> +        rt->rtsp_streams[i]->rtp_handle = NULL;
> +    }
>      return err;

try this:
for(i=0; i < rt->nb_rtsp_streams; i++) {
    url_close(rt->rtsp_streams[i]->rtp_handle);
    rt->rtsp_streams[i]->rtp_handle = NULL;
}
maybe it needs a if(rt->rtsp_streams[i]->rtp_handle) dunno

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Observe your enemies, for they first find out your faults. -- Antisthenes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080319/f2b28eec/attachment.pgp>



More information about the ffmpeg-devel mailing list