avformat/avidec: optimize probe
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 23 Dec 2014 15:32:26 +0000 (16:32 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 23 Dec 2014 15:32:26 +0000 (16:32 +0100)
about 2x as fast

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/avidec.c

index 03c05a748c64ef24fb5e0ccf7553909fd6cb0648..7016d2d40006d22b68fee911ef0e1a49a6a901cb 100644 (file)
@@ -1863,8 +1863,8 @@ static int avi_probe(AVProbeData *p)
 
     /* check file header */
     for (i = 0; avi_headers[i][0]; i++)
-        if (!memcmp(p->buf,     avi_headers[i],     4) &&
-            !memcmp(p->buf + 8, avi_headers[i] + 4, 4))
+        if (AV_RL32(p->buf    ) == AV_RL32(avi_headers[i]    ) &&
+            AV_RL32(p->buf + 8) == AV_RL32(avi_headers[i] + 4))
             return AVPROBE_SCORE_MAX;
 
     return 0;