pull/696/head
Mattia Iavarone 6 years ago
parent a9c86d091e
commit abe74ebf35
  1. 20
      cameraview/src/main/java/com/otaliastudios/cameraview/video/FullVideoRecorder.java

@ -232,15 +232,8 @@ public abstract class FullVideoRecorder extends VideoRecorder {
break; break;
} }
if (shouldStop) { if (shouldStop) {
// Do not block this callback with a stop() call: stop() closes the LOG.i("OnInfoListener:", "Stopping");
// MediaRecorder and I think that in some cases this creates a deadlock. stop(false);
new Handler().post(new Runnable() {
@Override
public void run() {
LOG.i("OnInfoListener:", "Stopping");
stop(false);
}
});
} }
} }
}); });
@ -250,13 +243,8 @@ public abstract class FullVideoRecorder extends VideoRecorder {
LOG.e("OnErrorListener: got error", what, extra, ". Stopping."); LOG.e("OnErrorListener: got error", what, extra, ". Stopping.");
mResult = null; mResult = null;
mError = new RuntimeException("MediaRecorder error: " + what + " " + extra); mError = new RuntimeException("MediaRecorder error: " + what + " " + extra);
new Handler().post(new Runnable() { LOG.i("OnErrorListener:", "Stopping");
@Override stop(false);
public void run() {
LOG.i("OnErrorListener:", "Stopping");
stop(false);
}
});
} }
}); });

Loading…
Cancel
Save