[FFmpeg-cvslog] ac3_probe: speedup by checking for header earlier

Michael Niedermayer git at videolan.org
Thu May 31 16:32:58 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu May 31 16:14:27 2012 +0200| [ebfe0c6eb800222955d480b943b646e7a6ee2a1c] | committer: Michael Niedermayer

ac3_probe: speedup by checking for header earlier

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

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

 libavformat/ac3dec.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/ac3dec.c b/libavformat/ac3dec.c
index ba05f74..3741ee4 100644
--- a/libavformat/ac3dec.c
+++ b/libavformat/ac3dec.c
@@ -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++) {



More information about the ffmpeg-cvslog mailing list