Skip to content

Commit

Permalink
add seek function to decoder API
Browse files Browse the repository at this point in the history
  • Loading branch information
gerwin3 committed Apr 29, 2024
1 parent 9b0b7d5 commit a4f3c90
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,22 @@ impl Decoder {
})
}

/// Seek in reader.
///
/// See [`Reader::seek`](crate::io::Reader::seek) for more information.
#[inline]
pub fn seek(&mut self, timestamp_milliseconds: i64) -> Result<()> {
self.reader.seek(timestamp_milliseconds)
}

/// Seek to start of reader.
///
/// See [`Reader::seek_to_start`](crate::io::Reader::seek_to_start) for more information.
#[inline]
pub fn seek_to_start(&mut self) -> Result<()> {
self.reader.seek_to_start()
}

/// Split the decoder into a decoder (of type [`DecoderSplit`]) and a [`Reader`].
///
/// This allows the caller to detach stream reading from decoding, which is useful for advanced
Expand Down

0 comments on commit a4f3c90

Please sign in to comment.