[Ffmpeg-devel] BeOS cleanup work in progress

Michael Niedermayer michaelni
Thu Jan 25 01:12:07 CET 2007


Hi

On Wed, Jan 24, 2007 at 06:05:51PM +0100, Fran?ois Revol wrote:
[...]
> >
> > and there is some code duplication in the patch which has to be
> > removed
> > (yes the E* -> AVERROR_* mapping swiches)
> 
> I originally wrote a func for that, but there were only 2...
> Did a static func in avcodec.h

i do not agree with these functions in avcodec.h, i also do not agree with
moving them into libavutil as its IMO bloat from libavutils point of view
and last but not least they of course MUST NOT be static in a header
as that would duplicate them in the object files, now iam curious if they
are needed at all ...


> Also added av_errno_from_averror() for apps to convert to something
> others can use or print with strerror().

rejected, this has nothing to do with changing E* -> AVERROR_*


> 
> Btw, I checked what opengroup says about errno...
> All pages only state errors are non-zero, then on the page for errno.h
> it states they are supposed to be positive, but they changed that to
> comply with some C99 thingy... So originally they weren't supposed to
> be positive.
> There is no way to revert that in BeOS anyway, whatever CNNNN says.
> Besides it's way more logical if you think about it.
> 
> Fran?ois.

[confgure stuff i dont maintain]

[...]
> Index: libavcodec/avcodec.h
> ===================================================================
> --- libavcodec/avcodec.h	(revision 7684)
> +++ libavcodec/avcodec.h	(working copy)
> @@ -2692,6 +2692,93 @@
>  
>  extern unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
>  
> +/* error handling */
> +#define AVERROR_UNKNOWN     (-1)  /* unknown error */
> +#define AVERROR_IO          (-2)  /* i/o error */
> +#define AVERROR_NUMEXPECTED (-3)  /* number syntax expected in filename */
> +#define AVERROR_INVALIDDATA (-4)  /* invalid data found */
> +#define AVERROR_NOMEM       (-5)  /* not enough memory */
> +#define AVERROR_NOFMT       (-6)  /* unknown format */
> +#define AVERROR_NOTSUPP     (-7)  /* operation not supported */
> +#define AVERROR_NOENT       (-8)  /* no such entry */
> +#define AVERROR_BROKENPIPE  (-9)  /* other end is down */
> +#define AVERROR_INTERRUPTED (-10) /* operation interrupted */
> +#define AVERROR_TRYAGAIN    (-11) /* busy at the moment... */

ok, but please change the comments to doxygen compatible ones /**< i think */
note, this can be done in a seperate patch/commit if you like

[...]

> Index: libavformat/framehook.c
> ===================================================================
> --- libavformat/framehook.c	(revision 7684)
> +++ libavformat/framehook.c	(working copy)
> @@ -57,7 +57,7 @@
>  
>      fhe = av_mallocz(sizeof(*fhe));
>      if (!fhe) {
> -        return errno;
> +        return av_error_from_errno(errno);

hmm this should be a AVERROR_NOMEM i think? if so it should
be changed in a seperate commit before the other AVERROR stuff


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I count him braver who overcomes his desires than him who conquers his
enemies for the hardest victory is over self. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070125/3235b143/attachment.pgp>



More information about the ffmpeg-devel mailing list