From 51f2efd48c6e58c6e835b11f54a81784a8191788 Mon Sep 17 00:00:00 2001 From: Alexey Dubrov Date: Sun, 16 Feb 2020 16:08:53 +0300 Subject: [PATCH 1/4] Fix initial brightness value --- .../java/org/schabi/newpipe/player/MainVideoPlayer.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java b/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java index 31f7dd74a..ebb9e2423 100644 --- a/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java @@ -909,6 +909,14 @@ public final class MainVideoPlayer extends AppCompatActivity final float currentVolumeNormalized = (float) getAudioReactor().getVolume() / getAudioReactor().getMaxVolume(); volumeProgressBar.setProgress((int) (volumeProgressBar.getMax() * currentVolumeNormalized)); } + + final float screenBrightness = getWindow().getAttributes().screenBrightness; + brightnessProgressBar.setProgress((int) (brightnessProgressBar.getMax() * screenBrightness)); + + if (DEBUG) Log.d(TAG, "setInitialGestureValues: volumeProgressBar.getProgress() [" + + volumeProgressBar.getProgress() + "] " + + "brightnessProgressBar.getProgress() [" + + brightnessProgressBar.getProgress() + "]"); } @Override From e3a891688bb71bda52f26ffe697f469e347aaf3d Mon Sep 17 00:00:00 2001 From: Alexey Dubrov Date: Mon, 17 Feb 2020 12:11:00 +0300 Subject: [PATCH 2/4] Get brightness from settings if screenBrightness is set to auto --- .../java/org/schabi/newpipe/player/MainVideoPlayer.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java b/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java index ebb9e2423..3340f1107 100644 --- a/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java @@ -910,7 +910,11 @@ public final class MainVideoPlayer extends AppCompatActivity volumeProgressBar.setProgress((int) (volumeProgressBar.getMax() * currentVolumeNormalized)); } - final float screenBrightness = getWindow().getAttributes().screenBrightness; + float screenBrightness = getWindow().getAttributes().screenBrightness; + if (screenBrightness < 0) + screenBrightness = Settings.System.getInt(getContentResolver(), + Settings.System.SCREEN_BRIGHTNESS, 0) / 255.0f; + brightnessProgressBar.setProgress((int) (brightnessProgressBar.getMax() * screenBrightness)); if (DEBUG) Log.d(TAG, "setInitialGestureValues: volumeProgressBar.getProgress() [" From 831e9985e2484665f8cc1159ea30d208d8c71cc1 Mon Sep 17 00:00:00 2001 From: Laurent Arnoud Date: Tue, 18 Feb 2020 21:50:28 +0100 Subject: [PATCH 3/4] Migrate annotation to androidx on ReCaptchaActivity --- app/src/main/java/org/schabi/newpipe/ReCaptchaActivity.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/ReCaptchaActivity.java b/app/src/main/java/org/schabi/newpipe/ReCaptchaActivity.java index d72f729b5..4219638d6 100644 --- a/app/src/main/java/org/schabi/newpipe/ReCaptchaActivity.java +++ b/app/src/main/java/org/schabi/newpipe/ReCaptchaActivity.java @@ -18,7 +18,7 @@ import android.webkit.WebViewClient; import org.schabi.newpipe.util.ThemeHelper; -import javax.annotation.Nonnull; +import androidx.annotation.NonNull; /* * Created by beneth on 06.12.16. @@ -147,7 +147,7 @@ public class ReCaptchaActivity extends AppCompatActivity { // add other methods to extract cookies here } - private void addYoutubeCookies(@Nonnull String cookies) { + private void addYoutubeCookies(@NonNull String cookies) { if (cookies.contains("s_gl=") || cookies.contains("goojf=") || cookies.contains("VISITOR_INFO1_LIVE=")) { // youtube seems to also need the other cookies: addCookie(cookies); From 61632b3d9dca940230d733c4eac0dd7e17df2d01 Mon Sep 17 00:00:00 2001 From: kapodamy Date: Thu, 20 Feb 2020 13:20:20 -0300 Subject: [PATCH 4/4] fixup for #3081 * dont write the "sbpg" box in video tracks --- .../java/org/schabi/newpipe/streams/Mp4FromDashWriter.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/streams/Mp4FromDashWriter.java b/app/src/main/java/org/schabi/newpipe/streams/Mp4FromDashWriter.java index 57a7aaa9c..64e4534cb 100644 --- a/app/src/main/java/org/schabi/newpipe/streams/Mp4FromDashWriter.java +++ b/app/src/main/java/org/schabi/newpipe/streams/Mp4FromDashWriter.java @@ -291,7 +291,9 @@ public class Mp4FromDashWriter { sampleCount[i] = 1;// the index is not base zero sampleExtra[i] = -1; } - writeEntryArray(tablesInfo[i].sbgp, 1, sampleCount[i]); + if (tablesInfo[i].sbgp > 0) { + writeEntryArray(tablesInfo[i].sbgp, 1, sampleCount[i]); + } } if (auxBuffer == null) {