Skip to content

Commit

Permalink
Support seeking
Browse files Browse the repository at this point in the history
Adds seeking support, with page granularity.
This might be not fine enough for some use cases,
but on human perception scales most times its enough.

Fixes #3
  • Loading branch information
est31 committed May 30, 2017
1 parent 0866df9 commit 5748b26
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/inside_ogg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,15 @@ impl<T: Read + Seek> OggStreamReader<T> {
pub fn get_last_absgp(&self) -> Option<u64> {
self.absgp_of_last_read
}

/// Seeks to the specified absolute granule position
pub fn seek_absgp(&mut self, absgp :u64) -> Result<(), VorbisError> {
try!(self.rdr.seek_absgp(None, absgp));
// Reset the internal state after the seek
self.absgp_of_last_read = None;
self.pwr = PreviousWindowRight::new();
Ok(())
}
}


Expand Down

0 comments on commit 5748b26

Please sign in to comment.