[FFmpeg-devel] [PATCH] Increase to 4K the initial size of the probe.

Giovanni Motta giovanni.motta at gmail.com
Wed May 7 00:48:01 CEST 2014


In a 320Kbps MP3, a 2K buffer contains roughly 2 frames. If there is a
misidentification in the initial 2K bytes mp3_read_probe() doesn't have a
chance to decode the headers of the minimum 4 frames that are necessary to
return a meaningful score for a MP3.

---
 libavformat/internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/internal.h b/libavformat/internal.h
index 66fb5d6..b75cb5f 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -27,7 +27,7 @@
 #define MAX_URL_SIZE 4096

 /** size of probe buffer, for guessing file type from file contents */
-#define PROBE_BUF_MIN 2048
+#define PROBE_BUF_MIN 4096
 #define PROBE_BUF_MAX (1 << 20)

 #ifdef DEBUG
--
1.9.1.423.g4596e3a


More information about the ffmpeg-devel mailing list