[FFmpeg-devel] [RFC] Error code fixes before the Big Bump

Michael Niedermayer michaelni at gmx.at
Wed Apr 20 01:31:31 CEST 2011


On Mon, Apr 18, 2011 at 01:35:48PM +0200, Stefano Sabatini wrote:
> [adding libav-devel to recipients, as this concerns API/ABI compatibility]
> 
> On date Saturday 2011-04-16 19:12:34 +0200, Nicolas George encoded:
> > Le septidi 27 germinal, an CCXIX, Stefano Sabatini a écrit :
> > > * implement AVERROR_EOF as a libav* specific error code, rather than
> > >   mask the EPIPE POSIX error code which has a different semantics
> > > 
> > > * implement AVERROR_INVALIDDATA as a libav* specific error code (already
> > >   implemented but it was controversial), and fix the
> > >   AVERROR(EINVAL)/AVERROR_INVALIDDATA conflict
> > 
> > Seems reasonable.
> > 
> > > * drop AVERROR_NUMEXPECTED (not very important, but I believe it is a
> > >   too much specific error code, so I'd prefer to replace it with
> > >   AVERROR(EINVAL)
> > 
> > A more generic AVERROR_SYNTAX could be possible too.
> > 
> > > |bumping it to 51 will changes the codes returned by all libs using libavutil
> > > |all of them would need to bump major.
> > > |i dont think this is reasonable, thus we should undo all error redefinitions
> > > |before they become real and debian burns you at the stake
> > > 
> > > but I don't think this is a real issue (assuming that all the libav*
> > > major versions are bumped at the same time), and this is my argument:
> > 
> > I think the point is precisely in your parentheses: changing the error codes
> > requires bumping the major version for all the libraries, not just
> > libavutil.
> > 
> 
> > One thought in passing: If the error codes get changed, it may be a good
> > idea to adapt the definition of AVERROR(errno) to something like:
> > 
> > #define AVERROR(e) (-(e) - 1)
> > 
> > This would have the benefit that when some old piece of code returns -1
> > instead of a meaningful error code, it would not displayed as "Permission
> > denied" or whatever errno code is 1 on this particular platform.
> 
> I'd prefer to just return the negated POSIX error code, and avoid
> other weird mapping.
> 
> Possibly we could introduce an AVERROR_GENERIC code and replace -1
> with it, not that I like the idea too much.

i like using -1 and later replacing by the correct error code.

anyway the patch is ok as long as ABI/API between ffmpeg/libav are
maintained


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 3
"Rare item" - "Common item with rare defect or maybe just a lie"
"Professional" - "'Toy' made in china, not functional except as doorstop"
"Experts will know" - "The seller hopes you are not an expert"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110420/aa596967/attachment.asc>


More information about the ffmpeg-devel mailing list