]> git.nihav.org Git - nihav.git/commitdiff
ape: zero samples in silent frames
authorKostya Shishkov <kostya.shishkov@gmail.com>
Sat, 3 Oct 2020 13:38:51 +0000 (15:38 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Sat, 3 Oct 2020 13:38:51 +0000 (15:38 +0200)
nihav-llaudio/src/codecs/ape.rs

index a89f0c5342a18b14dcf39b8b88220da49cb0336e..773c116024e51ce8402de771c46ab5612d60dc76 100644 (file)
@@ -181,6 +181,11 @@ impl NADecoder for APEDecoder {
                     (self.decode_stereo)(&mut coder, &mut self.left, &mut self.right)?;
                     self.fmode.filter_stereo(&mut self.left, &mut self.right);
                 }
+            } else {
+                for l in self.left.iter_mut() { *l = 0; }
+                if self.is_stereo {
+                    for r in self.right.iter_mut() { *r = 0; }
+                }
             }
 
             if self.version >= 0x3990 || nblocks == self.blocksperframe {