cleanup the empty files after recording

This commit is contained in:
tibbi 2016-06-16 17:08:06 +02:00
parent 5c80e98888
commit d5d98fcf31
1 changed files with 5 additions and 0 deletions

View File

@ -67,6 +67,7 @@ public class Preview extends ViewGroup implements SurfaceHolder.Callback, View.O
isFlashEnabled = false;
isVideoMode = false;
isSurfaceCreated = false;
curVideoPath = "";
}
public void setCamera(int cameraId) {
@ -507,6 +508,10 @@ public class Preview extends ViewGroup implements SurfaceHolder.Callback, View.O
}
}
final File file = new File(curVideoPath);
if (file.exists() && file.length() == 0) {
file.delete();
}
isRecording = false;
}