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

Nicolas George nicolas.george at normalesup.org
Sat Apr 16 19:12:34 CEST 2011


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.

Regards,

-- 
  Nicolas George
-------------- 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/20110416/59ae90b4/attachment.asc>


More information about the ffmpeg-devel mailing list