From 09d9ac2d2ead25a83f00d1bc21d686ffb64949b0 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Wed, 20 Jun 2018 15:36:42 +0000 Subject: [PATCH] rpicamsrc: Don't destroy the camera component on startup error Just disable the camera component when it fails to start. The most common reason is that the camera device is already in use, and if we just disable the mmal component correct cleanup will happen later --- sys/rpicamsrc/RaspiCapture.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/rpicamsrc/RaspiCapture.c b/sys/rpicamsrc/RaspiCapture.c index cae5cf61ce..a7d72a0e1b 100644 --- a/sys/rpicamsrc/RaspiCapture.c +++ b/sys/rpicamsrc/RaspiCapture.c @@ -1268,9 +1268,8 @@ raspi_capture_set_format_and_start(RASPIVID_STATE *state) return status; error: - if (camera) - mmal_component_destroy(camera); + mmal_component_disable(camera); return status; }