mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-12-24 11:52:06 +08:00
This fixes error handling for BeOS, removing the need for some ifdefs.
AVERROR_ defines are moved to avcodec.h as they are needed in there as well. Feel free to move that to avutil/common.h. Bumped up avcodec/format version numbers as though it's binary compatible we will want to rebuild apps as error values changed. Please from now on use return AVERROR(EFOO) instead of the ugly return -EFOO in your code. This also removes the need for berrno.h. Originally committed as revision 7965 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
@@ -37,8 +37,8 @@ extern "C" {
|
||||
#define AV_STRINGIFY(s) AV_TOSTRING(s)
|
||||
#define AV_TOSTRING(s) #s
|
||||
|
||||
#define LIBAVCODEC_VERSION_INT ((51<<16)+(32<<8)+0)
|
||||
#define LIBAVCODEC_VERSION 51.32.0
|
||||
#define LIBAVCODEC_VERSION_INT ((51<<16)+(33<<8)+0)
|
||||
#define LIBAVCODEC_VERSION 51.33.0
|
||||
#define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT
|
||||
|
||||
#define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION)
|
||||
@@ -2699,6 +2699,23 @@ int img_pad(AVPicture *dst, const AVPicture *src, int height, int width, int pix
|
||||
|
||||
extern unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
|
||||
|
||||
/* error handling */
|
||||
#if EINVAL > 0
|
||||
#define AVERROR(e) (-(e)) /**< returns a negative error code from a POSIX error code, to return from library functions. */
|
||||
#define AVUNERROR(e) (-(e)) /**< returns a POSIX error code from a library function error return value. */
|
||||
#else
|
||||
/* some platforms have E* and errno already negated. */
|
||||
#define AVERROR(e) (e)
|
||||
#define AVUNERROR(e) (e)
|
||||
#endif
|
||||
#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 */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user