[FFmpeg-devel] [PATCH] Redefine AVERROR_NOFMT as a specific FFmpeg error code at the next lavu major bump

Stefano Sabatini stefano.sabatini-lala
Mon Mar 15 00:08:54 CET 2010


On date Sunday 2010-03-14 20:06:34 +0100, Michael Niedermayer encoded:
> On Sat, Mar 13, 2010 at 09:50:34PM +0100, Stefano Sabatini wrote:
> > $subj.
> > -- 
> > FFmpeg = Faithless and Fiendish Mega Powered Excellent Guru
> 
> >  error.h |    3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 2941ec2a41518b3a058586be322100cfa2be746b  0007-Change-the-definition-of-AVERROR_NOFMT-at-the-next-l.patch
> > >From dc74163b0948fe0d84f7aa7a96b589c668cc60a8 Mon Sep 17 00:00:00 2001
> > From: Stefano Sabatini <stefano.sabatini-lala at poste.it>
> > Date: Sat, 13 Mar 2010 21:36:14 +0100
> > Subject: [PATCH 7/8] Change the definition of AVERROR_NOFMT at the next libavutil major
> >  bump, using an FFmpeg specific error code rather than EIILSEQ, which
> >  has a quite different semantics.
> 
> do we really need AVERROR_NOFMT?
> does this have any use outside of probe() ?

Currently grep reveals these uses:
./libavformat/utils.c:562:        err = AVERROR_NOFMT;
./libavformat/matroskadec.c:1147:        return AVERROR_NOFMT;
./libavcodec/g729dec.c:174:        return AVERROR_NOFMT;
./libavcodec/g729dec.c:227:        return (AVERROR_NOFMT);

Both the uses in matroskadec.c and g729dec.c look like they should be
replaced by one of AVERROR_INVALIDDATA / AVERROR_PATCHWELCOME /
AVERROR_NOTSUPP.

As for the use in av_open_input_file(), what should it return in case
of not found format error? To me it makes sense to keep this error
code, and I can't find valid POSIX candidates for this type of error
so I proposed to use an FFmpeg specific code (while using EILSEQ for
it is plain wrong).

(BTW from a quick inspection the error code choices in FFmpeg look
quite scanty, luckily we just ignore the values of the returned error
codes most of the times...).

Regards.
-- 
FFmpeg = Forgiving and Fostering Mean Pitiful Eretic Goblin



More information about the ffmpeg-devel mailing list