[FFmpeg-devel] [PATCH] Bunch of accumulated patches...

Michael Niedermayer michaelni
Tue Jan 15 01:47:27 CET 2008


On Mon, Jan 14, 2008 at 07:12:28PM -0500, Rich Felker wrote:
> On Mon, Jan 14, 2008 at 11:41:43PM +0000, M?ns Rullg?rd wrote:
> > Rich Felker <dalias at aerifal.cx> writes:
> > 
> > > On Mon, Jan 14, 2008 at 11:47:49PM +0100, Michael Niedermayer wrote:
> > >> On Mon, Jan 14, 2008 at 05:54:19PM -0500, Rich Felker wrote:
> > >> > On Mon, Jan 14, 2008 at 11:31:37PM +0100, Michael Niedermayer wrote:
> > >> > > there are really several seperate things here
> > >> > > 1. non posix systems -> work on libos (see the ML) or fix your system
> > >> > > 2. error cases which cant be represented well with posix E* -> send
> > >> > >    patches which define custom E* for us, note, this also needs a
> > >> > >    configure check so that they dont interfere with any posix E*
> > >> > 
> > >> > E* is reserved if errno.h is included. #defining anything beginning
> > >> > with E is a very bad idea.
> > >> 
> > >> then AV_E* or just the AVERROR_* still we must ensure the value
> > >> doesnt collide with any of the standard E*
> > >
> > > Then AVERROR_ values should be long long with bits higher than 32bit
> > > set.. IMO it's a mistake to try to mix E* values with one's own error
> > > codes, but this is a reasonably safe method that could probably be
> > > used..
> > 
> > FWIW, the standard requires E* to be positive integer constant
> > expressions with type int.
> 
> 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*
2. only use POSIX E* (that is somewhat limiting as many errors cases dont
   have a reasonably matching E* from POSIX)
3. just pick random values for our extra error codes, theres a
   philosophical collision possibility
4. add a check to configure to choose unused E* (this is easy by using
   strerror())


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080115/7a0e8118/attachment.pgp>



More information about the ffmpeg-devel mailing list