playback/player: android: Don't do custom surface width/height calculations if we have no media width/height

This commit is contained in:
Sebastian Dröge 2015-11-13 10:36:52 +01:00
parent 00cad0da11
commit eaed96145e

View file

@ -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);