Fix potential audio delay during source cleanup

This commit is contained in:
Haruka 2022-03-07 06:31:53 +07:00 committed by GitHub
parent 6788ec2533
commit c403fb49d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -694,8 +694,8 @@ class AudioPlayer(threading.Thread):
self._current_error = exc
self.stop()
finally:
self.source.cleanup()
self._call_after()
self.source.cleanup()
def _call_after(self) -> None:
error = self._current_error