forked from platypush/platypush
Do proper decapsulation for PiCamera wrapped object when reinitialized
This commit is contained in:
parent
ac42f7eba4
commit
6e6092e4b2
1 changed files with 4 additions and 4 deletions
|
@ -147,13 +147,13 @@ class CameraPiPlugin(CameraPlugin):
|
||||||
if not sock:
|
if not sock:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
picam = self.open_device(**camera.info.to_dict()) if camera.object is None or camera.object.closed \
|
if camera.object is None or camera.object.closed:
|
||||||
else camera.object
|
camera = self.open_device(**camera.info.to_dict())
|
||||||
|
|
||||||
try:
|
try:
|
||||||
picam.start_recording(sock, format=stream_format)
|
camera.object.start_recording(sock, format=stream_format)
|
||||||
while camera.stream_event.is_set():
|
while camera.stream_event.is_set():
|
||||||
picam.wait_recording(1)
|
camera.object.wait_recording(1)
|
||||||
except ConnectionError:
|
except ConnectionError:
|
||||||
self.logger.info('Client closed connection')
|
self.logger.info('Client closed connection')
|
||||||
finally:
|
finally:
|
||||||
|
|
Loading…
Reference in a new issue