diff --git a/crates/ec-probe/src/raw.rs b/crates/ec-probe/src/raw.rs index 9101904c..bddfc266 100644 --- a/crates/ec-probe/src/raw.rs +++ b/crates/ec-probe/src/raw.rs @@ -204,10 +204,12 @@ impl RawDemuxer { Ok(f) => return Ok(f), Err(e) if e.is_need_more() && tail => { // The tail of a file: whatever is left is the last frame. - return Ok(Framing { - bytes: left, - samples: self.frame_samples(), - }); + let samples = match kind { + Kind::Mp3 => ec_mp3::FrameHeader::parse(self.window()) + .map_or(self.frame_samples(), |h| h.samples_per_frame() as u64), + _ => self.frame_samples(), + }; + return Ok(Framing { bytes: left, samples }); } Err(_) if skipped < (1 << 20) => { self.head += 1;