1
0
mirror of https://github.com/TeamNewPipe/NewPipe.git synced 2024-11-25 20:42:34 +01:00

Use url comparison between queue items when disabling preloading

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.
This commit is contained in:
Stypox 2021-07-21 18:07:26 +02:00
parent 4a2bd7bd7b
commit fa8630ddae
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23

View File

@ -813,7 +813,7 @@ public final class VideoDetailFragment
@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();
}