RustAudio / ogg

Ogg container decoder and encoder written in pure Rust
Other
113 stars 21 forks source link

Speed up seeking to the beginning of a stream. #9

Closed kaymes closed 4 years ago

kaymes commented 4 years ago

When seeking to the beginning of a stream it isn't necessary to do the full bisect search. Instead, the beginning of the first valid page that was found can be used.

This makes a noticeable performance difference in an online setting where each read of the file requires a network request. With this patch rewinding a track to the beginning is mus faster.

This situation arises in the librespot Spotify client.