summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2015-11-13 10:36:52 +0100
committerSebastian Dröge <sebastian@centricular.com>2015-11-13 10:36:52 +0100
commitf8393928d7f5c77975ea47281c47929cd477af27 (patch)
treea99163589e7060e56e9b9f1a832d8dc043ba2bd5
parentf97846ea0fc619ed914dec6eff1b9c1f89fde76c (diff)
android: Don't do custom surface width/height calculations if we have no media width/height
-rw-r--r--android/src/org/freedesktop/gstreamer/player/GStreamerSurfaceView.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/android/src/org/freedesktop/gstreamer/player/GStreamerSurfaceView.java b/android/src/org/freedesktop/gstreamer/player/GStreamerSurfaceView.java
index f2dd8a9..075f035 100644
--- a/android/src/org/freedesktop/gstreamer/player/GStreamerSurfaceView.java
+++ b/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);