# HG changeset patch # User banan # Date 1278317803 0 # Node ID de9e45d04063d6669ff5e73d59d43b080245cb8e # Parent c2a1bb63bd30ee109831be8886c4f79627e9b89f 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 diff -r c2a1bb63bd30 -r de9e45d04063 dca.c --- a/dca.c Mon Jul 05 01:43:47 2010 +0000 +++ b/dca.c Mon Jul 05 08:16:43 2010 +0000 @@ -1298,7 +1298,13 @@ switch(bits) { case 0x5a5a5a5a: { int ext_base_ch = s->prim_channels; - int ext_amode; + int ext_amode, xch_fsize; + + /* validate sync word using XCHFSIZE field */ + xch_fsize = show_bits(&s->gb, 10); + if((s->frame_size != (get_bits_count(&s->gb) >> 3) - 4 + xch_fsize) && + (s->frame_size != (get_bits_count(&s->gb) >> 3) - 4 + xch_fsize + 1)) + continue; /* skip length-to-end-of-frame field for the moment */ skip_bits(&s->gb, 10);