[FFmpeg-devel] Bug in av_open_input_stream() since r11071 (ByteIOContext change) [3rd try to send]

Stefan Lucke stefan
Sat Dec 22 23:17:27 CET 2007


On Saturday 22 December 2007, matthieu castet wrote:
> Hi,
> 
> Stefan Lucke wrote:
> > Old version in libavformat/utils.c from r11007 looks like:
> > 
> > int av_open_input_stream(AVFormatContext **ic_ptr,
> >                          ByteIOContext *pb, const char *filename,
> >                          AVInputFormat *fmt, AVFormatParameters *ap)

> > In current svn version (r11278), supplied parameter pointer gets ic's
> > pb independent of it's value.
> > 
> > line 377: ic->pb = pb;
> > 
> > It may be NULL in case current format has AVFMT_NOFILE set.
> > 
> > Attached patch fixes this issue.
> AFAIK, format with AVFMT_NOFILE doesn't use ByteIOContext, so it doesn't 
> need to be allocated. That the same issue than av_open_input_file.

The point to my opinion is it was previously legal to call av_open_input_stream()
with pb == NULL, as this functions provided the ByteIOContext.
Now it doesn't do this anymore, pb == NULL is _illegal_ and should be asserted.

> 
> 
> See http://article.gmane.org/gmane.comp.video.ffmpeg.devel/59965

That's exact the place which troubles me at the moment.
I was not aware of that discussion on this list.

As Bj?rn pointed out, the trick with AVFMT_NOFILE is not a good idea
in my eyes too.

I think i can cv that in softdevice.

> 
> PS : Are you the author of softdevice ?

Not the initial one.
I would call myself maintainer.

Stefan Lucke




More information about the ffmpeg-devel mailing list