From eaed96145e604b4e543255f76e5903605aa9448d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 13 Nov 2015 10:36:52 +0100 Subject: [PATCH] playback/player: android: Don't do custom surface width/height calculations if we have no media width/height --- .../freedesktop/gstreamer/player/GStreamerSurfaceView.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/playback/player/android/src/org/freedesktop/gstreamer/player/GStreamerSurfaceView.java b/playback/player/android/src/org/freedesktop/gstreamer/player/GStreamerSurfaceView.java index f2dd8a9bf0..075f035880 100644 --- a/playback/player/android/src/org/freedesktop/gstreamer/player/GStreamerSurfaceView.java +++ b/playback/player/android/src/org/freedesktop/gstreamer/player/GStreamerSurfaceView.java @@ -50,6 +50,11 @@ public class GStreamerSurfaceView extends SurfaceView { // we are given the freedom to do so. @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + if (media_width == 0 || media_height == 0) { + super.onMeasure(widthMeasureSpec, heightMeasureSpec); + return; + } + int width = 0, height = 0; int wmode = View.MeasureSpec.getMode(widthMeasureSpec); int hmode = View.MeasureSpec.getMode(heightMeasureSpec);