FIX: Handle stop_streaming exceptions in the main loop of the camera plugin.

Otherwise camera process teardown errors may bubble up and prevent the
plugin from restarting the streaming.
This commit is contained in:
Fabio Manganiello 2024-02-24 21:36:08 +01:00
parent 8999a226b1
commit 4c92bdd11c
Signed by: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -1035,7 +1035,13 @@ class CameraPlugin(RunnablePlugin, ABC):
camera = cameras[0] camera = cameras[0]
wait_for_either(self._should_stop, camera.stop_stream_event) wait_for_either(self._should_stop, camera.stop_stream_event)
try:
self.stop_streaming() self.stop_streaming()
except Exception as e:
self.logger.warning('Error while stopping the camera stream: %s', e)
finally:
self.wait_stop(timeout=2)
# vim:sw=4:ts=4:et: # vim:sw=4:ts=4:et: