]> git.nihav.org Git - nihav.git/commitdiff
wavpack: seek to the last frame before skipping frames
authorKostya Shishkov <kostya.shishkov@gmail.com>
Sat, 3 Oct 2020 10:24:53 +0000 (12:24 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Sat, 3 Oct 2020 10:24:53 +0000 (12:24 +0200)
nihav-llaudio/src/demuxers/wavpack.rs

index 9cfbba8b8ea10af2e809f2db9fb4285fd8a6b1e6..d07a5a2844cace2f49ebb82a10374986d074dc97 100644 (file)
@@ -230,6 +230,8 @@ impl<'a> DemuxCore<'a> for WavPackDemuxer<'a> {
                 }
             } else {
                 let mut hdrbuf = [0u8; WV_HEADER_SIZE];
+                let lastoff = self.known_frames.last().unwrap_or(&FrameSeekInfo::default()).off;
+                self.src.seek(SeekFrom::Start(lastoff))?;
                 loop {
                                           self.src.peek_buf(&mut hdrbuf)?;
                     let hdr = WVHeader::parse(&hdrbuf)?;