mirror of
https://github.com/samsonjs/media.git
synced 2026-04-15 12:55:46 +00:00
Fix passing of invalid surface to video renderers
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=158684924
This commit is contained in:
parent
cb5b6fba01
commit
5cd3a9baa0
1 changed files with 3 additions and 2 deletions
|
|
@ -221,8 +221,9 @@ public class SimpleExoPlayer implements ExoPlayer {
|
|||
if (surfaceHolder == null) {
|
||||
setVideoSurfaceInternal(null, false);
|
||||
} else {
|
||||
setVideoSurfaceInternal(surfaceHolder.getSurface(), false);
|
||||
surfaceHolder.addCallback(componentListener);
|
||||
Surface surface = surfaceHolder.getSurface();
|
||||
setVideoSurfaceInternal(surface != null && surface.isValid() ? surface : null, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -273,9 +274,9 @@ public class SimpleExoPlayer implements ExoPlayer {
|
|||
if (textureView.getSurfaceTextureListener() != null) {
|
||||
Log.w(TAG, "Replacing existing SurfaceTextureListener.");
|
||||
}
|
||||
textureView.setSurfaceTextureListener(componentListener);
|
||||
SurfaceTexture surfaceTexture = textureView.getSurfaceTexture();
|
||||
setVideoSurfaceInternal(surfaceTexture == null ? null : new Surface(surfaceTexture), true);
|
||||
textureView.setSurfaceTextureListener(componentListener);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue