[FFmpeg-devel] av_open_input_file

Fabrizio Milo aka misto mistobaan
Fri Dec 10 20:54:45 CET 2010


Something like this?

index 9a4d735..05c8c18 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -184,6 +184,10 @@ int url_alloc(URLContext **puc, const char
*filename, int flags)
         av_strlcpy(proto_str, filename, FFMIN(proto_len+1, sizeof(proto_str)));

     up = first_protocol;
+    if (up == NULL) // No format registered
+    {
+        return AVERROR_NOFMT;
+    }
     while (up != NULL) {
         if (!strcmp(proto_str, up->name))
             return url_alloc_for_protocol (puc, up, filename, flags);
diff --git a/libavutil/error.c b/libavutil/error.c
index b6d6019..249b1fd 100644
--- a/libavutil/error.c
+++ b/libavutil/error.c
@@ -29,6 +29,7 @@ int av_strerror(int errnum, char *errbuf, size_t errbuf_size)
     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
FFmpeg, patches welcome"; break;
+    case AVERROR_NOFMT:             errstr = "Unknown format"; break;
     }

     if (errstr) {

--------------------------
Luck favors the prepared mind. (Pasteur)



More information about the ffmpeg-devel mailing list