Fixed captures trying to restart recording for a stopped stream

This commit is contained in:
Joel Collins 2019-01-17 12:23:54 +00:00
parent cbf709e8d8
commit 646dc24a91
2 changed files with 51 additions and 59 deletions

View file

@ -313,6 +313,8 @@ class BaseCamera(object):
self.frames_iterator = self.frames()
logging.debug("Entering worker thread.")
self.state['stream_active'] = True
for frame in self.frames_iterator:
self.frame = frame
self.event.set() # send signal to clients
@ -337,5 +339,7 @@ class BaseCamera(object):
pass
logging.debug("BaseCamera worker thread exiting...")
# Set stream_activate state
self.state['stream_active'] = False
# Reset thread
self.thread = None