Merge pull request #37 from tzutalin/master

Fix the crash if stop recording after release
pull/40/head
Florent CHAMPIGNY 8 years ago committed by GitHub
commit ff882f1067
  1. 3
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/manager/impl/Camera1Manager.java
  2. 3
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/manager/impl/Camera2Manager.java

@ -185,6 +185,9 @@ public class Camera1Manager extends BaseCameraManager<Integer, SurfaceHolder.Cal
backgroundHandler.post(new Runnable() { backgroundHandler.post(new Runnable() {
@Override @Override
public void run() { public void run() {
// Tzutalin++ 2017/05. If calling release function, it should not be executed
if (context == null) return;
if (prepareVideoRecorder()) { if (prepareVideoRecorder()) {
videoRecorder.start(); videoRecorder.start();
isVideoRecording = true; isVideoRecording = true;

@ -267,6 +267,9 @@ public final class Camera2Manager extends BaseCameraManager<String, TextureView.
backgroundHandler.post(new Runnable() { backgroundHandler.post(new Runnable() {
@Override @Override
public void run() { public void run() {
// Tzutalin++ 2017/05. If calling release function, it should not be executed
if (context == null) return;
closePreviewSession(); closePreviewSession();
if (prepareVideoRecorder()) { if (prepareVideoRecorder()) {

Loading…
Cancel
Save