]> git.sesse.net Git - ffmpeg/commitdiff
avformat/dtsdec: skip the first 4k in dts_probe()
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 2 Aug 2014 15:25:04 +0000 (17:25 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 2 Aug 2014 15:25:04 +0000 (17:25 +0200)
DTS primarly needs to be separated from PCM, and PCM can contain cliping and
overshoots at the very start which can mimic DTS headers.

If this isnt sufficient then more of the DTS stream has to be decoded
and analyzed

Fixes ticket3784

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

index 330c42851635c63abd6d5b55d3c13220e8aeaa97..0ebf8472c5cb6250497c82d0107f1dec8e58fd4f 100644 (file)
@@ -36,7 +36,7 @@ static int dts_probe(AVProbeData *p)
     int sum, max, i;
     int64_t diff = 0;
 
-    buf = p->buf;
+    buf = p->buf + FFMIN(4096, p->buf_size);
 
     for(; buf < (p->buf+p->buf_size)-2; buf+=2) {
         bufp = buf;