1
0
Fork 0
mirror of https://github.com/librespot-org/librespot.git synced 2025-10-03 01:39:28 +02:00

Always seek to starting position

This commit is contained in:
Roderick van Domburg 2021-12-30 21:52:15 +01:00
parent 05c768f612
commit 286a031d94
No known key found for this signature in database
GPG key ID: A9EF5222A26F0451
2 changed files with 17 additions and 8 deletions

View file

@ -387,6 +387,10 @@ impl AudioFileStreaming {
bytes_per_second: usize,
play_from_beginning: bool,
) -> Result<AudioFileStreaming, Error> {
// When the audio file is really small, this `download_size` may turn out to be
// larger than the audio file we're going to stream later on. This is OK; requesting
// `Content-Range` > `Content-Length` will return the complete file with status code
// 206 Partial Content.
let download_size = if play_from_beginning {
INITIAL_DOWNLOAD_SIZE
+ max(