Add additional null checks to PlaybackController.findBestDisplayMode

This commit is contained in:
Niels van Velzen authored and Niels van Velzen committed 2026-10-12 21:54:11 +02:00
1 parent 5c26dafb0b
commit 4f97f16338
1 file changed
+3 -3
@@ -289,11 +289,11 @@ public class PlaybackController implements PlaybackControllerNotifiable {
}
}
private Display.Mode findBestDisplayMode(MediaStream videoStream) {
if (mFragment == null || mDisplayModes == null || videoStream.getRealFrameRate() == null)
@Nullable
private Display.Mode findBestDisplayMode(@Nullable MediaStream videoStream) {
if (mFragment == null || mDisplayModes == null || videoStream == null || videoStream.getRealFrameRate() == null || videoStream.getWidth() == null || videoStream.getHeight() == null)
return null;
int curWeight = 0;
Display.Mode bestMode = null;
int sourceRate = Math.round(videoStream.getRealFrameRate() * 100);