Ensure after is called inside the daemon thread for players.
This commit is contained in:
parent
6166cbc2e7
commit
132ac45010
@ -118,9 +118,10 @@ class StreamPlayer(threading.Thread):
|
||||
except Exception as e:
|
||||
self._current_error = e
|
||||
self.stop()
|
||||
finally:
|
||||
self._call_after()
|
||||
|
||||
def stop(self):
|
||||
self._end.set()
|
||||
def _call_after(self):
|
||||
if self.after is not None:
|
||||
try:
|
||||
arg_count = len(inspect.signature(self.after).parameters)
|
||||
@ -136,6 +137,9 @@ class StreamPlayer(threading.Thread):
|
||||
except:
|
||||
pass
|
||||
|
||||
def stop(self):
|
||||
self._end.set()
|
||||
|
||||
@property
|
||||
def error(self):
|
||||
return self._current_error
|
||||
|
Loading…
x
Reference in New Issue
Block a user