Skip to content

Commit

Permalink
refactor(seek) explain why seek to sample works
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdsk committed Apr 3, 2024
1 parent 4e14b0a commit 3bafe32
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/decoder/vorbis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ where

#[inline]
fn try_seek(&mut self, pos: Duration) -> Result<(), SeekError> {
// note sample rate in vorbis encoding is constant
let samples = pos.as_secs_f32() * self.sample_rate() as f32;
self.stream_reader.seek_absgp_pg(samples as u64)?;

Expand Down

0 comments on commit 3bafe32

Please sign in to comment.