Commit 15bcdf3b by olly Committed by Oliver Woodman

Don't use TextureView's SurfaceTexture unless available

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164434943
parent df05195f
......@@ -276,7 +276,8 @@ public class SimpleExoPlayer implements ExoPlayer {
Log.w(TAG, "Replacing existing SurfaceTextureListener.");
}
textureView.setSurfaceTextureListener(componentListener);
SurfaceTexture surfaceTexture = textureView.getSurfaceTexture();
SurfaceTexture surfaceTexture = textureView.isAvailable() ? textureView.getSurfaceTexture()
: null;
setVideoSurfaceInternal(surfaceTexture == null ? null : new Surface(surfaceTexture), true);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment