[FFmpeg-trac] #97(avcodec:new): libcelt_dec.c -- ENOTRECOVERABLE undeclared when compiling on Mac OS X
FFmpeg
trac at avcodec.org
Sat Apr 23 02:28:41 CEST 2011
#97: libcelt_dec.c -- ENOTRECOVERABLE undeclared when compiling on Mac OS X
-----------------------------------+--------------------------
Reporter: RLeatherwood | Type: defect
Status: new | Priority: normal
Component: avcodec | Version: unspecified
Keywords: libcelt libcelt_dec.c | Blocked By:
Blocking: | Reproduced: 0
Analyzed: 0 |
-----------------------------------+--------------------------
I got the following error while compiling in support for libcelt (git
89451dd) on Mac OS X 10.6:
{{{
CC libavcodec/libcelt_dec.o
libavcodec/libcelt_dec.c: In function ‘ff_celt_error_to_averror’:
libavcodec/libcelt_dec.c:44: error: ‘ENOTRECOVERABLE’ undeclared (first
use in this function)
libavcodec/libcelt_dec.c:44: error: (Each undeclared identifier is
reported only once
libavcodec/libcelt_dec.c:44: error: for each function it appears in.)
libavcodec/libcelt_dec.c:46: error: ‘AVERROR_UNKNOWN’ undeclared (first
use in this function)
make: *** [libavcodec/libcelt_dec.o] Error 1
}}}
I dug a little deeper and found that ENOTRECOVERABLE is not defined by
Apple in their system headers.
I created two patches to fix the problem. The first patch uses an include
guard to detect compilation on Apple's system. It replaces ENOTRECOVERABLE
with EINVAL since I could not find a more appropriate error value to use.
The second patch just replaces ENOTRECOVERABLE entirely with EINVAL.
NOTE - It also looks like libcelt_dec.c needs to have AVERROR_UNKNOWN
replaced with AVERROR(EINVAL) due to the "big bump". This change is not in
my original patches.
Original code:
{{{
switch(err) {
case CELT_BAD_ARG: return AVERROR(EINVAL);
#ifdef CELT_BUFFER_TOO_SMALL
case CELT_BUFFER_TOO_SMALL: return AVERROR(ENOBUFS);
#endif
case CELT_INTERNAL_ERROR: return AVERROR(EFAULT);
case CELT_CORRUPTED_DATA: return AVERROR_INVALIDDATA;
case CELT_UNIMPLEMENTED: return AVERROR(ENOTSUP);
case CELT_INVALID_STATE: return AVERROR(ENOTRECOVERABLE);
case CELT_ALLOC_FAIL: return AVERROR(ENOMEM);
default: return AVERROR_UNKNOWN;
}}}
--
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/97>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list