Skip to content

Commit

Permalink
avoid add mediacodec while no running
Browse files Browse the repository at this point in the history
  • Loading branch information
pedroSG94 committed Mar 13, 2024
1 parent ed4eff7 commit 82cf921
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -712,7 +712,7 @@ private void prepareGlView(int width, int height, int rotation) {
}
glInterface.setRotation(0);
if (!glInterface.isRunning()) glInterface.start();
if (videoEncoder.getInputSurface() != null) {
if (videoEncoder.getInputSurface() != null && videoEncoder.isRunning()) {
glInterface.addMediaCodecSurface(videoEncoder.getInputSurface());
}
cameraManager.setSurfaceTexture(glInterface.getSurfaceTexture());
Expand Down
Expand Up @@ -656,7 +656,7 @@ private void prepareGlView(int width, int height, int rotation) {
}
glInterface.setRotation(rotation == 0 ? 270 : rotation - 90);
if (!glInterface.isRunning()) glInterface.start();
if (videoEncoder.getInputSurface() != null) {
if (videoEncoder.getInputSurface() != null && videoEncoder.isRunning()) {
glInterface.addMediaCodecSurface(videoEncoder.getInputSurface());
}
cameraManager.prepareCamera(glInterface.getSurfaceTexture(), videoEncoder.getWidth(),
Expand Down

0 comments on commit 82cf921

Please sign in to comment.