init video recorder only when the surface is ready

This commit is contained in:
tibbi
2016-06-13 22:15:52 +02:00
parent e04be7886f
commit 9e0a11c5d7
2 changed files with 9 additions and 6 deletions

View File

@ -236,6 +236,10 @@ public class Preview extends ViewGroup implements SurfaceHolder.Callback, View.O
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
setupPreview();
if (isVideoMode) {
initRecorder();
}
}
private void setupPreview() {