mirror of
https://github.com/librespot-org/librespot.git
synced 2025-10-03 09:49:31 +02:00
refactor: revert to while condition in download loop
This commit is contained in:
parent
791b18c376
commit
6f73a5571b
1 changed files with 5 additions and 9 deletions
|
@ -226,15 +226,11 @@ impl StreamLoaderController {
|
||||||
.expect(DOWNLOAD_STATUS_POISON_MSG);
|
.expect(DOWNLOAD_STATUS_POISON_MSG);
|
||||||
let download_timeout = AudioFetchParams::get().download_timeout;
|
let download_timeout = AudioFetchParams::get().download_timeout;
|
||||||
|
|
||||||
loop {
|
while range.length
|
||||||
if range.length
|
> download_status
|
||||||
<= download_status
|
.downloaded
|
||||||
.downloaded
|
.contained_length_from_value(range.start)
|
||||||
.contained_length_from_value(range.start)
|
{
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
let (new_download_status, wait_result) = shared
|
let (new_download_status, wait_result) = shared
|
||||||
.cond
|
.cond
|
||||||
.wait_timeout(download_status, download_timeout)
|
.wait_timeout(download_status, download_timeout)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue