end = Some(off - size);
}
}
+ // check for MusicMatch tag
+ let ret = if let Some(endpos) = end {
+ br.seek(SeekFrom::Start(endpos - 0x30))
+ } else {
+ br.seek(SeekFrom::End(-0x30))
+ };
+ if ret.is_ok() && br.tell() > (0x2000 - 0x30) {
+ let mut buf = [0; 19];
+ br.peek_buf(&mut buf).unwrap();
+ if &buf == b"Brava Software Inc." {
+ br.seek(SeekFrom::Current(-20)).unwrap();
+ let mut mm_start = u64::from(br.read_u32le().unwrap());
+ if mm_start > 4 && mm_start + 0x2000 <= br.tell() {
+ let diff = (br.tell() - mm_start) & 3;
+ if diff != 0 {
+ mm_start -= 4 - diff;
+ }
+ end = Some(mm_start);
+ }
+ }
+ }
(is_raw, start, end)
}