diff options
-rw-r--r-- | src/android/camera_device.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 017a15ca..872c7b18 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -1223,6 +1223,13 @@ PixelFormat CameraDevice::toPixelFormat(int format) const */ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list) { + /* Before any configuration attempt, stop the camera if it's running. */ + if (running_) { + worker_.stop(); + camera_->stop(); + running_ = false; + } + /* * Generate an empty configuration, and construct a StreamConfiguration * for each camera3_stream to add to it. |