properly shutdown and unblock the final buffer

This commit is contained in:
Jakob Ketterl 2021-07-18 14:56:48 +02:00
parent 320521a74a
commit 8531d5e4ab

View File

@ -18,10 +18,10 @@ class Chain:
w2.setInput(buffer) w2.setInput(buffer)
def stop(self): def stop(self):
if self.output is not None:
self.output.stop()
for w in self.workers: for w in self.workers:
w.stop() w.stop()
self.setInput(None)
self.setOutput(None)
def setInput(self, buffer): def setInput(self, buffer):
if self.input == buffer: if self.input == buffer:
@ -32,6 +32,8 @@ class Chain:
def setOutput(self, buffer): def setOutput(self, buffer):
if self.output == buffer: if self.output == buffer:
return return
if self.output is not None:
self.output.stop()
self.output = buffer self.output = buffer
self.workers[-1].setOutput(buffer) self.workers[-1].setOutput(buffer)