[FFmpeg-cvslog] ipmovie_probe: speedup by avoiding memcmp() call

Michael Niedermayer git at videolan.org
Thu Jun 7 01:44:17 CEST 2012


ffmpeg | branch: release/0.11 | Michael Niedermayer <michaelni at gmx.at> | Thu May 31 16:19:26 2012 +0200| [0a311df6d96e5155bbfb1824be50f2e2b3f7a30e] | committer: Michael Niedermayer

ipmovie_probe: speedup by avoiding memcmp() call

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit cc4d80c99ff3169b71c62691d5c7602ef673c3dc)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0a311df6d96e5155bbfb1824be50f2e2b3f7a30e
---

 libavformat/ipmovie.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/ipmovie.c b/libavformat/ipmovie.c
index a60b961..30ed16d 100644
--- a/libavformat/ipmovie.c
+++ b/libavformat/ipmovie.c
@@ -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;



More information about the ffmpeg-cvslog mailing list