From c85b97a4841f6cf15fddd31acf807cd5491ec9f6 Mon Sep 17 00:00:00 2001 From: Robin Date: Tue, 4 May 2021 19:08:25 +0200 Subject: [PATCH] Fix: fragmentSize is below the minimum (#6238) noticed logs " CacheDataSink: fragmentSize is below the minimum recommended value of 2097152. This may cause poor cache performance. this fixes the issue by using ExoPlayers MIN_RECOMMENDED_FRAGMENT_SIZE. Unfortunately that field is private: https://github.com/google/ExoPlayer/blob/aeb306a164911aa1491b46c2db4da0d329c83c65/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/CacheDataSink.java#L123 --- .../java/org/schabi/newpipe/player/helper/PlayerHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHelper.java b/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHelper.java index 0a3ea908a..59b2fed17 100644 --- a/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHelper.java +++ b/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHelper.java @@ -297,7 +297,7 @@ public final class PlayerHelper { } public static long getPreferredFileSize() { - return 512 * 1024L; + return 2 * 1024 * 1024L; // ExoPlayer CacheDataSink.MIN_RECOMMENDED_FRAGMENT_SIZE } /**