Some of these were made possible by moving several common macros to
libavutil/macros.h.
While just at it, also improve the other headers a bit.
Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Add the feature test macro which is required for building with the
musl toolchain.
The feature test macro _XOPEN_SOURCE = 600 provides the XSI-compliant
version of strerror_r().
Signed-off-by: Jörg Krause <jkrause@posteo.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This code is intended for errors in external libraries
when no corresponding error code can be found.
AVERROR_UNKNOWN is too vague for that and looks like AVERROR_BUG.
The value returned by strerror_r may be positive depending on the system,
so it is necessary to use AVERROR() in order to get a negative
number. This way the successive negative check will not fail, and the
function will print a meaningful error message on the buffer.
AVERROR_NUMEXPECTED is used only in the image muxer and demuxer, and
has a too much specific meaning, which is better explained through a
log message. Thus it can be replaced by AVERROR(EINVAL).
This breaks API.
Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
The new error code is better than AVERROR(ENOENT), which has a
completely different semantics ("No such file or directory").
Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
This is different from AVERROR(EINTR) because calls that fail with EINTR
should usually be restarted.
Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
not defined.
This allows applications to check if av_strerror() cannot provide a
meaningful representation for the provided error code, without having
to actually check the filled string.
Originally committed as revision 23031 to svn://svn.ffmpeg.org/ffmpeg/trunk
number if strerror_r() did not succeed for whatever reason.
This avoids the need for the application to fill the string in case
strerror_r() fails, for example because the error code is not known.
Originally committed as revision 23015 to svn://svn.ffmpeg.org/ffmpeg/trunk
instead which is semantically equivalent.
See the thread:
Subject: [FFmpeg-devel] [RFC] The meaning of AVERROR_NOTSUPP
Date: Sat, 27 Mar 2010 00:51:13 +0100
Originally committed as revision 22981 to svn://svn.ffmpeg.org/ffmpeg/trunk