X-Git-Url: https://git.nihav.org/?p=nihav.git;a=blobdiff_plain;f=nihav-llaudio%2Fsrc%2Fcodecs%2Fape.rs;h=8a9073dda5228da15e7ac9c097246cefd8e762f9;hp=773c116024e51ce8402de771c46ab5612d60dc76;hb=379524159c95f1c3639976ccf35f9d47cd9732ac;hpb=06fc12ca7c3847de59211b891c325c02bd2f1795 diff --git a/nihav-llaudio/src/codecs/ape.rs b/nihav-llaudio/src/codecs/ape.rs index 773c116..8a9073d 100644 --- a/nihav-llaudio/src/codecs/ape.rs +++ b/nihav-llaudio/src/codecs/ape.rs @@ -126,7 +126,7 @@ impl NADecoder for APEDecoder { validate!(nblocks > 0); let bits = u32::from(pktbuf[4]); validate!(bits < 32); - self.data.truncate(0); + self.data.clear(); self.data.reserve((pktbuf.len() & !3) + 2); for word in pktbuf[8..].chunks_exact(4) { self.data.push(word[3]); @@ -169,7 +169,7 @@ impl NADecoder for APEDecoder { if self.is_stereo { self.right.resize(nblocks, 0); } - if (fflags & 3) == 0 { + if (!self.is_stereo && (fflags & 1) == 0) || (self.is_stereo && (fflags & 3) != 3) { if !self.is_stereo || (fflags & 4) != 0 { (self.decode_mono)(&mut coder, &mut self.left)?; self.fmode.filter_mono(&mut self.left);