Skip to content

Commit

Permalink
Use url comparison between queue items when disabling preloading
Browse files Browse the repository at this point in the history
From #4562: Disable player stream preloading only if the current stream is going to be replaced for sure (see this). equals() was implemented for PlayQueueItems, so that (only) the url is compared when checking them.
  • Loading branch information
Stypox committed Jul 21, 2021
1 parent 4a2bd7b commit fa8630d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ public void selectAndLoadVideo(final int newServiceId,
@NonNull final String newTitle,
@Nullable final PlayQueue newQueue) {
if (isPlayerAvailable() && newQueue != null && playQueue != null
&& !Objects.equals(newQueue.getItem(), playQueue.getItem())) {
&& playQueue.getItem() != null && !playQueue.getItem().getUrl().equals(newUrl)) {
// Preloading can be disabled since playback is surely being replaced.
player.disablePreloadingOfCurrentTrack();
}
Expand Down

0 comments on commit fa8630d

Please sign in to comment.