From 873f86bb9605a3155e17b929e728137480af111d Mon Sep 17 00:00:00 2001 From: Konstantin Seiler Date: Fri, 7 Feb 2020 23:52:20 +1100 Subject: [PATCH] Cancel preload requests to free bandwidth when repeating the same track. --- playback/src/player.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/playback/src/player.rs b/playback/src/player.rs index b30289b6..ef7484c7 100644 --- a/playback/src/player.rs +++ b/playback/src/player.rs @@ -1119,6 +1119,7 @@ impl PlayerInternal { loaded_track.stream_loader_controller.set_stream_mode(); loaded_track.stream_position_pcm = Self::position_ms_to_pcm(position_ms); } + self.preload = PlayerPreload::None; self.start_playback(track_id, play_request_id, loaded_track, play); return; } @@ -1182,6 +1183,7 @@ impl PlayerInternal { stream_position_pcm, }; + self.preload = PlayerPreload::None; self.start_playback(track_id, play_request_id, loaded_track, play); if let PlayerState::Invalid = self.state {