ipmovie_probe: speedup by avoiding memcmp() call
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 31 May 2012 14:19:26 +0000 (16:19 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 6 Jun 2012 22:55:24 +0000 (00:55 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cc4d80c99ff3169b71c62691d5c7602ef673c3dc)

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

index a60b961..30ed16d 100644 (file)
@@ -529,8 +529,9 @@ static int ipmovie_probe(AVProbeData *p)
     uint8_t *b = p->buf;
     uint8_t *b_end = p->buf + p->buf_size - sizeof(signature);
     do {
-        if (memcmp(b++, signature, sizeof(signature)) == 0)
+        if (b[0] == signature[0] && memcmp(b, signature, sizeof(signature)) == 0)
             return AVPROBE_SCORE_MAX;
+        b++;
     } while (b < b_end);
 
     return 0;