Skip to content

Commit

Permalink
audio: Use correct position index in seek_to_sample_frame
Browse files Browse the repository at this point in the history
  • Loading branch information
onkrot authored and torokati44 committed Jun 27, 2024
1 parent 5632638 commit 1ffb7d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/backend/audio/decoders/g711.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl<R: AsRef<[u8]> + Send + Sync> SeekableDecoder for G711ALawDecoder<Cursor<R>

#[inline]
fn seek_to_sample_frame(&mut self, frame: u32) {
let pos = u64::from(frame) * u64::from(self.num_channels()) * 2;
let pos = u64::from(frame);
self.reader.set_position(pos);
}
}
Expand Down Expand Up @@ -138,7 +138,7 @@ impl<R: AsRef<[u8]> + Send + Sync> SeekableDecoder for G711MuLawDecoder<Cursor<R

#[inline]
fn seek_to_sample_frame(&mut self, frame: u32) {
let pos: u64 = u64::from(frame) * u64::from(self.num_channels()) * 2;
let pos: u64 = u64::from(frame);
self.reader.set_position(pos);
}
}

0 comments on commit 1ffb7d3

Please sign in to comment.