From: Kostya Shishkov Date: Sat, 3 Oct 2020 10:24:53 +0000 (+0200) Subject: wavpack: seek to the last frame before skipping frames X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=7d6bb2e867e6f931a9791b2ee0ae66069edb4ae2;p=nihav.git wavpack: seek to the last frame before skipping frames --- diff --git a/nihav-llaudio/src/demuxers/wavpack.rs b/nihav-llaudio/src/demuxers/wavpack.rs index 9cfbba8..d07a5a2 100644 --- a/nihav-llaudio/src/demuxers/wavpack.rs +++ b/nihav-llaudio/src/demuxers/wavpack.rs @@ -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)?;