]> git.sesse.net Git - ffmpeg/commitdiff
do not read probe data if format is specified - match_ext() must be exported
authorFabrice Bellard <fabrice@bellard.org>
Mon, 18 Nov 2002 17:17:27 +0000 (17:17 +0000)
committerFabrice Bellard <fabrice@bellard.org>
Mon, 18 Nov 2002 17:17:27 +0000 (17:17 +0000)
Originally committed as revision 1222 to svn://svn.ffmpeg.org/ffmpeg/trunk

libav/utils.c

index c810d0c512d140fc3eb22ae7e6e2cd7cc7b0f0c7..bc706f68230be0e97115729f4838526d0745e791 100644 (file)
@@ -54,7 +54,7 @@ void av_register_output_format(AVOutputFormat *format)
     format->next = NULL;
 }
 
-static int match_ext(const char *filename, const char *extensions)
+int match_ext(const char *filename, const char *extensions)
 {
     const char *ext, *p;
     char ext1[32], *q;
@@ -335,9 +335,11 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
         if (buf_size > 0) {
             url_setbufsize(&ic->pb, buf_size);
         }
-        /* read probe data */
-        pd->buf_size = get_buffer(&ic->pb, buf, PROBE_BUF_SIZE);
-        url_fseek(&ic->pb, 0, SEEK_SET);
+        if (!fmt) {
+            /* read probe data */
+            pd->buf_size = get_buffer(&ic->pb, buf, PROBE_BUF_SIZE);
+            url_fseek(&ic->pb, 0, SEEK_SET);
+        }
     }
     
     /* guess file format */