ac3_probe: speedup by checking for header earlier
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 31 May 2012 14:14:27 +0000 (16:14 +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 ebfe0c6eb800222955d480b943b646e7a6ee2a1c)

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

index ba05f74..3741ee4 100644 (file)
@@ -37,6 +37,8 @@ static int ac3_eac3_probe(AVProbeData *p, enum CodecID expected_codec_id)
     end = buf + p->buf_size;
 
     for(; buf < end; buf++) {
+        if(buf > p->buf && (buf[0] != 0x0B || buf[1] != 0x77) )
+            continue;
         buf2 = buf;
 
         for(frames = 0; buf2 < end; frames++) {