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

Michael Niedermayer michaelni
Tue Jan 15 03:37:25 CET 2008

On Mon, Jan 14, 2008 at 09:03:49PM -0500, Rich Felker wrote:
> 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?

copy and paste from the source:
#define AVERROR_UNKNOWN     AVERROR(EINVAL)  /**< unknown error */
#define AVERROR_IO          AVERROR(EIO)     /**< I/O error */
#define AVERROR_NUMEXPECTED AVERROR(EDOM)    /**< Number syntax expected in filename. */
#define AVERROR_INVALIDDATA AVERROR(EINVAL)  /**< invalid data found */
#define AVERROR_NOMEM       AVERROR(ENOMEM)  /**< not enough memory */
#define AVERROR_NOFMT       AVERROR(EILSEQ)  /**< unknown format */
#define AVERROR_NOTSUPP     AVERROR(ENOSYS)  /**< Operation not supported. */
#define AVERROR_NOENT       AVERROR(ENOENT)  /**< No such file or directory. */
#define AVERROR_PATCHWELCOME    -MKTAG('P','A','W','E') /**< Not yet implemented in FFmpeg. Patches welcome. */

we also use
EINTR if url_interrupt_cb() returns non zero in some loops in network code
EPIPE (seeking with non seekable)

note, the AVERROR() is just a macro to workaround beos non posix E*, aka
they have the +- wrong ...


> > 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.

iam not sure, iam just RTFMing and beliving what it says:
man strerror:
On some systems, strerror() returns NULL if the error number is unknown. On
other systems, strerror() returns a string something like "Error nnn occurred"
and sets errno to EINVAL if the error number is unknown.

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Frequently ignored awnser#1 FFmpeg bugs should be sent to our bugtracker, user
questions for the command line tools ffmpeg, ffplay, ... as well as questions
about how to use libav* should be sent to the ffmpeg-user mailinglist.
-------------- 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/6d21b315/attachment.pgp>

More information about the ffmpeg-devel mailing list