Only stop the loop if it is set

This commit is contained in:
Fabio Manganiello 2020-09-30 13:52:37 +02:00
parent 7947c1031d
commit 9b23ab7015
1 changed files with 2 additions and 1 deletions

View File

@ -77,7 +77,8 @@ class Pipeline:
def stop(self):
self.pipeline.set_state(Gst.State.NULL)
self.loop.stop()
if self.loop:
self.loop.stop()
self.loop = None
def get_volume(self) -> float: