summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@digia.com>2014-06-24 17:08:03 +0200
committerYoann Lopes <yoann.lopes@digia.com>2014-06-30 16:03:26 +0200
commitc8b88cd02752fb623f65dc3fe930d60fc00fd15d (patch)
treec71677a12af92058e835ba4df3b37a852c6c7b41
parent23d7bf7ac882b899c7500611b0d57f4b2993d8e2 (diff)
Android: fix crash when stopping the camera while a recording is active
When unloading the camera, any active recording is automatically stopped, which in turn triggers the viewfinder to be restarted... We don't try anymore to restart the viewfinder after stopping recording unless the camera is still active. Change-Id: I77e4e3fc8d7116ac660d8bb23f6c400ebed4ffed Reviewed-by: Christian Stromme <christian.stromme@digia.com>
-rw-r--r--src/plugins/android/src/mediacapture/qandroidcapturesession.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/android/src/mediacapture/qandroidcapturesession.cpp b/src/plugins/android/src/mediacapture/qandroidcapturesession.cpp
index 44901a6c1..c053c8e38 100644
--- a/src/plugins/android/src/mediacapture/qandroidcapturesession.cpp
+++ b/src/plugins/android/src/mediacapture/qandroidcapturesession.cpp
@@ -269,7 +269,7 @@ void QAndroidCaptureSession::stop(bool error)
delete m_mediaRecorder;
m_mediaRecorder = 0;
- if (m_cameraSession) {
+ if (m_cameraSession && m_cameraSession->status() == QCamera::ActiveStatus) {
// Viewport needs to be restarted after recording
restartViewfinder();
}
@@ -516,6 +516,7 @@ void QAndroidCaptureSession::updateStatus()
if (m_cameraSession->status() == QCamera::StoppingStatus
|| !m_cameraSession->captureMode().testFlag(QCamera::CaptureVideo)) {
setState(QMediaRecorder::StoppedState);
+ return;
}
if (m_state == QMediaRecorder::RecordingState) {