From 7d6bb2e867e6f931a9791b2ee0ae66069edb4ae2 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Sat, 3 Oct 2020 12:24:53 +0200 Subject: [PATCH] wavpack: seek to the last frame before skipping frames --- nihav-llaudio/src/demuxers/wavpack.rs | 2 ++ 1 file changed, 2 insertions(+) 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)?; -- 2.39.5