Commit 79157f40 authored by Stefano Sabatini's avatar Stefano Sabatini Committed by Anton Khirnov

error: remove AVERROR_NUMEXPECTED

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: 's avatarStefano Sabatini <stefano.sabatini-lala@poste.it>
Signed-off-by: 's avatarAnton Khirnov <anton@khirnov.net>
parent 58f84639
...@@ -3722,7 +3722,7 @@ static void opt_output_file(const char *filename) ...@@ -3722,7 +3722,7 @@ static void opt_output_file(const char *filename)
/* check filename in case of an image number is expected */ /* check filename in case of an image number is expected */
if (oc->oformat->flags & AVFMT_NEEDNUMBER) { if (oc->oformat->flags & AVFMT_NEEDNUMBER) {
if (!av_filename_number_test(oc->filename)) { if (!av_filename_number_test(oc->filename)) {
print_error(oc->filename, AVERROR_NUMEXPECTED); print_error(oc->filename, AVERROR(EINVAL));
ffmpeg_exit(1); ffmpeg_exit(1);
} }
} }
......
...@@ -581,7 +581,7 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename, ...@@ -581,7 +581,7 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
/* check filename in case an image number is expected */ /* check filename in case an image number is expected */
if (fmt->flags & AVFMT_NEEDNUMBER) { if (fmt->flags & AVFMT_NEEDNUMBER) {
if (!av_filename_number_test(filename)) { if (!av_filename_number_test(filename)) {
err = AVERROR_NUMEXPECTED; err = AVERROR(EINVAL);
goto fail; goto fail;
} }
} }
......
...@@ -27,7 +27,6 @@ int av_strerror(int errnum, char *errbuf, size_t errbuf_size) ...@@ -27,7 +27,6 @@ int av_strerror(int errnum, char *errbuf, size_t errbuf_size)
switch (errnum) { switch (errnum) {
case AVERROR_EOF: errstr = "End of file"; break; case AVERROR_EOF: errstr = "End of file"; break;
case AVERROR_INVALIDDATA: errstr = "Invalid data found when processing input"; break; case AVERROR_INVALIDDATA: errstr = "Invalid data found when processing input"; break;
case AVERROR_NUMEXPECTED: errstr = "Number syntax expected in filename"; break;
case AVERROR_PATCHWELCOME: errstr = "Not yet implemented in Libav, patches welcome"; break; case AVERROR_PATCHWELCOME: errstr = "Not yet implemented in Libav, patches welcome"; break;
case AVERROR_DEMUXER_NOT_FOUND: errstr = "Demuxer not found"; break; case AVERROR_DEMUXER_NOT_FOUND: errstr = "Demuxer not found"; break;
case AVERROR_MUXER_NOT_FOUND: errstr = "Muxer not found"; break; case AVERROR_MUXER_NOT_FOUND: errstr = "Muxer not found"; break;
......
...@@ -42,7 +42,6 @@ ...@@ -42,7 +42,6 @@
#define AVERROR_PATCHWELCOME (-MKTAG('P','A','W','E')) ///< Not yet implemented in Libav, patches welcome #define AVERROR_PATCHWELCOME (-MKTAG('P','A','W','E')) ///< Not yet implemented in Libav, patches welcome
#define AVERROR_INVALIDDATA (-MKTAG('I','N','D','A')) ///< Invalid data found when processing input #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
#define AVERROR_DEMUXER_NOT_FOUND (-MKTAG(0xF8,'D','E','M')) ///< Demuxer not found #define AVERROR_DEMUXER_NOT_FOUND (-MKTAG(0xF8,'D','E','M')) ///< Demuxer not found
#define AVERROR_MUXER_NOT_FOUND (-MKTAG(0xF8,'M','U','X')) ///< Muxer not found #define AVERROR_MUXER_NOT_FOUND (-MKTAG(0xF8,'M','U','X')) ///< Muxer not found
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment