[FFmpeg-devel] [PATCH][RFC] Use AVERROR_DEMUXER_NOT_FOUND retcode

Andrey Utkin andrey.krieger.utkin at gmail.com
Tue Jul 30 15:09:09 CEST 2013


I was asked "how to distinguish error cases of unsupported input format and of broken file".
I figured out that constant AVERROR_DEMUXER_NOT_FOUND is currently unused, and AVERROR_INVALIDDATA was returned instead in av_probe_input_buffer().
I didn't test this change yet. I just ask if this point is valid.
---8<---
---
 libavformat/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index f798510..1ced7f6 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -388,7 +388,7 @@ int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt,
 
     if (!*fmt) {
         av_free(buf);
-        return AVERROR_INVALIDDATA;
+        return AVERROR_DEMUXER_NOT_FOUND;
     }
 
     /* rewind. reuse probe buffer to avoid seeking */
-- 
1.8.1.5



More information about the ffmpeg-devel mailing list