[FFmpeg-devel] [PATCH] allow empty params for av_open_input_stream()

Michael Niedermayer michaelni
Sun Jun 29 10:25:47 CEST 2008


On Sat, Jun 28, 2008 at 08:58:38PM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> see $attached, I'm using it in my realmedia/rdt/rtp patch.
> 
> Ronald

> Index: ffmpeg/libavformat/utils.c
> ===================================================================
> --- ffmpeg.orig/libavformat/utils.c	2008-06-28 15:17:54.000000000 -0400
> +++ ffmpeg/libavformat/utils.c	2008-06-28 17:32:38.000000000 -0400
> @@ -381,7 +381,7 @@
>      ic->pb = pb;
>      ic->duration = AV_NOPTS_VALUE;
>      ic->start_time = AV_NOPTS_VALUE;
> -    av_strlcpy(ic->filename, filename, sizeof(ic->filename));
> +    if (filename) av_strlcpy(ic->filename, filename, sizeof(ic->filename));
>  
>      /* allocate private data */
>      if (fmt->priv_data_size > 0) {

I dont see the sense of this hunk


> @@ -394,12 +394,14 @@
>          ic->priv_data = NULL;
>      }
>  
> +    if (ic->iformat->read_header) {
>      err = ic->iformat->read_header(ic, ap);
>      if (err < 0)
>          goto fail;
>  
>      if (pb && !ic->data_offset)
>          ic->data_offset = url_ftell(ic->pb);
> +    }
>  
>      *ic_ptr = ic;
>      return 0;

this should have the {} just over the read_header() related part so a 
NULL read_header would be equivalent to an return 0 read_header

[...]
-- 
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/20080629/a551fa94/attachment.pgp>



More information about the ffmpeg-devel mailing list