1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-12-31 12:09:05 +00:00

Try to prevent invalid aspectRatio of SurfaceView

If the video's hieght is 0, the aspectRatio is set to Float.NaN which can cause further issues. Do not assign invalid values for the aspectRatio.
This commit is contained in:
TobiGr
2025-12-26 23:49:30 +01:00
committed by tobigr
parent 718335d733
commit 7101aecc98

View File

@@ -100,7 +100,7 @@ public class ExpandableSurfaceView extends SurfaceView {
}
public void setAspectRatio(final float aspectRatio) {
if (videoAspectRatio == aspectRatio) {
if (videoAspectRatio == aspectRatio || aspectRatio == 0 || !Float.isFinite(aspectRatio)) {
return;
}