[FFmpeg-devel] [PATCH 1/2] avformat: add AVFMT_FILE to allow demuxers to be used with and without files

Benoit Fouet benoit.fouet at free.fr
Fri Sep 12 16:19:05 CEST 2014


Hi,

----- Mail original -----
> On Fri, 12 Sep 2014 12:29:36 +0200
> Michael Niedermayer <michaelni at gmx.at> wrote:
> 
> > Suggested-by: Benoit Fouet <benoit.fouet at free.fr>
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > ---
> >  doc/APIchanges         |    3 +++
> >  libavformat/avformat.h |    8 ++++++++
> >  libavformat/format.c   |    3 ++-
> >  libavformat/version.h  |    4 ++--
> >  4 files changed, 15 insertions(+), 3 deletions(-)
> > 

[...]

> > diff --git a/libavformat/avformat.h b/libavformat/avformat.h
> > index b915148..a95d702 100644
> > --- a/libavformat/avformat.h
> > +++ b/libavformat/avformat.h
> > @@ -446,6 +446,14 @@ typedef struct AVProbeData {
> >  
> >  #define AVFMT_SEEK_TO_PTS   0x4000000 /**< Seeking is based on PTS
> >  */
> >  
> > +#define AVFMT_FILE          0x8000000 /**< demuxer can be used
> > with a file, this
> > +                                           is default if
> > AVFMT_NOFILE is not set.
> 
> It's default, but it's not set? That's very strange.
> 
> > +                                           If AVFMT_NOFILE and
> > AVFMT_FILE is set
> > +                                           then the demuxer can be
> > used with and
> > +                                           without a file (so this
> > flag makes
> > +                                           only sense together
> > with AVFMT_NOFILE)
> 
> Very confusing. Without knowing the context (hack for img2 stuff) I
> wouldn't know what this means.
> 
> I think I would prefer the previous patch, which just special-cases
> image2. image2 probing should be fixed eventually, and it'd be better
> not to add strange API artifacts just because we're not there yet.
> 

Now that I see this patch, I agree. Let's just add a hack for image2 in the probe function and be done with it...
You're right about the fact that only image2 probing is weird (as Michael explained) and we shouldn't add such a thing just for that.
Sorry Michael for having you lose some time to put this in place.

-- 
Ben


More information about the ffmpeg-devel mailing list