rpicamsrc: Don't destroy the camera component on startup error
authorJan Schmidt <jan@centricular.com>
Wed, 20 Jun 2018 15:36:42 +0000 (15:36 +0000)
committerTim-Philipp Müller <tim@centricular.com>
Fri, 10 Jul 2020 15:46:23 +0000 (16:46 +0100)
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

index cae5cf6..a7d72a0 100644 (file)
@@ -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;
 }