diff options
author | foo86 <foobaz86@gmail.com> | 2015-04-28 17:47:53 +0300 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-04-28 19:29:47 +0200 |
commit | 191dd219d9c955a379cf52b18731c334ae70e475 (patch) | |
tree | 6e1a3bd5d94aa710eb0a89e5d0db814dabd17418 | |
parent | e2877bdf3862325c2982c3237d9bf28f1bbf793f (diff) | |
download | ffmpeg-191dd219d9c955a379cf52b18731c334ae70e475.tar.gz |
avformat/dtsdec: Extend DTS core sync word
Check extended sync word for 16-bit LE and BE core streams to reduce
probability of alias sync detection. Previously sync word extension was
checked only for 14-bit streams.
This follows up the similar change in avcodec/dca_parser.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/dtsdec.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/dtsdec.c b/libavformat/dtsdec.c index 50b14c6635..da0fb61a60 100644 --- a/libavformat/dtsdec.c +++ b/libavformat/dtsdec.c @@ -50,9 +50,11 @@ static int dts_probe(AVProbeData *p) diff += FFABS(((int16_t)AV_RL16(buf)) - (int16_t)AV_RL16(buf-4)); /* regular bitstream */ - if (state == DCA_SYNCWORD_CORE_BE) + if (state == DCA_SYNCWORD_CORE_BE && + (bytestream_get_be16(&bufp) & 0xFC00) == 0xFC00) marker = 0; - else if (state == DCA_SYNCWORD_CORE_LE) + else if (state == DCA_SYNCWORD_CORE_LE && + (bytestream_get_be16(&bufp) & 0x00FC) == 0x00FC) marker = 1; /* 14 bits big-endian bitstream */ |