[FFmpeg-devel] [PATCH] Bunch of accumulated patches...
Rich Felker
dalias
Tue Jan 15 03:03:49 CET 2008
On Tue, Jan 15, 2008 at 01:47:27AM +0100, Michael Niedermayer wrote:
> > Ah yeah I forgot the positivity requirement. So negative values makes
> > it easy to define your own errors.
>
> functions in libav* return negative ints as errors
> we will not change all int return types to long long (because its inefficient
> on 32bit archs), so the positivity vs. negativity doesnt help
>
> this leaves 4 obvious options
> 1. drop all usage of POSIX E*
This would probably be my preference.
> 2. only use POSIX E* (that is somewhat limiting as many errors cases dont
> have a reasonably matching E* from POSIX)
Also somewhat reasonable but I agree it's limiting. Could you give
some examples of what errors are used for in libav* so the
requirements are a bit clearer?
> 3. just pick random values for our extra error codes, theres a
> philosophical collision possibility
While this would probably work in practice unless someone
intentionally designed a nasty system to clash with it, it's ugly and
hackish beyond all imagination..
> 4. add a check to configure to choose unused E* (this is easy by using
> strerror())
Are you sure? strerror returns a string for unknown errors, and the
string it returns is implementation-defined. I don't see how it can
help you identify which error values are unused.
Rich
More information about the ffmpeg-devel
mailing list