[fix-error-codes-handling PATCH] Revert redefinition of the AVERROR_INVALIDDATA and _NUMEXPECTED macros at the next lavu major bump.

Stefano Sabatini stefano.sabatini-lala
Tue Mar 16 23:12:16 CET 2010


Such change would cause the return codes issued by all the libraries
depending on libavutil to change as well, causing weeping and gnashing
of teeth amongst most distributions.

The change would need a major bump of all the libavutil depending
libraries, so for the moment the change is deferred to the major bump
corresponding to the version with the symbolical value of 999.
---
 libavutil/error.h |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavutil/error.h b/libavutil/error.h
index 28fa925..17c26d5 100644
--- a/libavutil/error.h
+++ b/libavutil/error.h
@@ -38,13 +38,11 @@
 #endif
 
 #if LIBAVUTIL_VERSION_MAJOR < 51
-#define AVERROR_INVALIDDATA AVERROR(EINVAL)  ///< Invalid data found when processing input
 #define AVERROR_IO          AVERROR(EIO)     ///< I/O error
 #define AVERROR_NOENT       AVERROR(ENOENT)  ///< No such file or directory
 #define AVERROR_NOFMT       AVERROR(EILSEQ)  ///< Unknown format
 #define AVERROR_NOMEM       AVERROR(ENOMEM)  ///< Not enough memory
 #define AVERROR_NOTSUPP     AVERROR(ENOSYS)  ///< Operation not supported
-#define AVERROR_NUMEXPECTED AVERROR(EDOM)    ///< Number syntax expected in filename
 #define AVERROR_UNKNOWN     AVERROR(EINVAL)  ///< Unknown error
 #endif
 
@@ -52,9 +50,12 @@
 
 #define AVERROR_PATCHWELCOME    (-MKTAG('P','A','W','E')) ///< Not yet implemented in FFmpeg, patches welcome
 
-#if LIBAVUTIL_VERSION_MAJOR > 50
+#if LIBAVUTIL_VERSION_MAJOR > 999
 #define AVERROR_INVALIDDATA     (-MKTAG('I','N','D','A')) ///< Invalid data found when processing input
 #define AVERROR_NUMEXPECTED     (-MKTAG('N','U','E','X')) ///< Number syntax expected in filename
+#else
+#define AVERROR_INVALIDDATA AVERROR(EINVAL)  ///< Invalid data found when processing input
+#define AVERROR_NUMEXPECTED AVERROR(EDOM)    ///< Number syntax expected in filename
 #endif
 
 /**
-- 
1.6.0.4


--tThc/1wpZn/ma/RB--



More information about the ffmpeg-devel mailing list