[FFmpeg-devel] [PATCH] improved electronicarts detection

Reimar Döffinger Reimar.Doeffinger
Tue Sep 15 11:36:46 CEST 2009


Use the first size field that we already misuse for endianness detection
for probing. Not much point in trying to support (probably non-existant)
files that we couldn't even reliably detect the endianness of.
Surprisingly passes probetest.
Index: libavformat/electronicarts.c
===================================================================
--- libavformat/electronicarts.c        (revision 19849)
+++ libavformat/electronicarts.c        (working copy)
@@ -389,9 +389,13 @@
     case MPCh_TAG:
     case MVhd_TAG:
     case MVIh_TAG:
-        return AVPROBE_SCORE_MAX;
+        break;
+    default:
+        return 0;
     }
-    return 0;
+    if (AV_RL32(&p->buf[4]) > 0xfffff && AV_RB32(&p->buf[4]) > 0xfffff)
+        return 0;
+    return AVPROBE_SCORE_MAX;
 }
 
 static int ea_read_header(AVFormatContext *s,




More information about the ffmpeg-devel mailing list