Mercurial > libavcodec.hg
comparison dca.c @ 12092:de9e45d04063 libavcodec
DCA: Occasionally a false XCH sync word can turn up after the core DTS data,
to verify the sync word the extension fsize field should be compared to
the core data length field.
Patch by nick.nbrereton@net
author | banan |
---|---|
date | Mon, 05 Jul 2010 08:16:43 +0000 |
parents | c2a1bb63bd30 |
children | 8b28e74de2c0 |
comparison
equal
deleted
inserted
replaced
12091:c2a1bb63bd30 | 12092:de9e45d04063 |
---|---|
1296 uint32_t bits = get_bits_long(&s->gb, 32); | 1296 uint32_t bits = get_bits_long(&s->gb, 32); |
1297 | 1297 |
1298 switch(bits) { | 1298 switch(bits) { |
1299 case 0x5a5a5a5a: { | 1299 case 0x5a5a5a5a: { |
1300 int ext_base_ch = s->prim_channels; | 1300 int ext_base_ch = s->prim_channels; |
1301 int ext_amode; | 1301 int ext_amode, xch_fsize; |
1302 | |
1303 /* validate sync word using XCHFSIZE field */ | |
1304 xch_fsize = show_bits(&s->gb, 10); | |
1305 if((s->frame_size != (get_bits_count(&s->gb) >> 3) - 4 + xch_fsize) && | |
1306 (s->frame_size != (get_bits_count(&s->gb) >> 3) - 4 + xch_fsize + 1)) | |
1307 continue; | |
1302 | 1308 |
1303 /* skip length-to-end-of-frame field for the moment */ | 1309 /* skip length-to-end-of-frame field for the moment */ |
1304 skip_bits(&s->gb, 10); | 1310 skip_bits(&s->gb, 10); |
1305 | 1311 |
1306 /* extension amode should == 1, number of channels in extension */ | 1312 /* extension amode should == 1, number of channels in extension */ |