[FFmpeg-devel] [PATCH]lavf/icodec: Improve probe function

Carl Eugen Hoyos cehoyos at ag.or.at
Tue Jan 12 13:33:53 CET 2016


Hi!

Attached patch improves ico probing, previously mpeg-2 frames could be 
detected.

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavformat/icodec.c b/libavformat/icodec.c
index 22e2099..c3e87ea 100644
--- a/libavformat/icodec.c
+++ b/libavformat/icodec.c
@@ -44,8 +44,12 @@ typedef struct {
 
 static int probe(AVProbeData *p)
 {
-    if (AV_RL16(p->buf) == 0 && AV_RL16(p->buf + 2) == 1 && AV_RL16(p->buf + 4))
-        return AVPROBE_SCORE_MAX / 4;
+    if (   AV_RL16(p->buf) == 0
+        && AV_RL16(p->buf + 2) == 1
+        && AV_RL16(p->buf + 4)
+        && AV_RL16(p->buf + 10) == 1
+        && !p->buf[13])
+        return AVPROBE_SCORE_MAX / 4 + 1;
     return 0;
 }
 


More information about the ffmpeg-devel mailing list