[FFmpeg-devel] [RFC] Error code fixes before the Big Bump
Stefano Sabatini
stefano.sabatini-lala at poste.it
Sat Apr 16 17:51:40 CEST 2011
Hi,
there are some problems related to error codes which I would like to
fix. They can be fixed only with a coordinated big bump of all the
libav* libraries, so this can be considered a good moment to do this.
The mentioned problems are:
* 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
* 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)
I thought about Michael objection in
http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/105883/focus=107317:
|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:
an external library public function should not return an error code
from a libav* library (and thus change behavior if the return code of
libav* changes), but should rather map the libav* error code to a
library-specific error code.
For example we don't have functions which return libfreetype error
codes, but we map them to the corresponding libav* error codes.
Relevant threads:
* AVERROR_EOF replacement first discussion:
http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/105883
* Big bump error codes related discussion:
http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/125963/focus=126000
Comments are welcome.
More information about the ffmpeg-devel
mailing list