possible fix for reported audio issues

https://forums.ankiweb.net/t/2-1-48-release-candidate/13268/6

This is the only area of the sound code that has changed since 2.1.47
This commit is contained in:
Damien Elmes 2021-09-16 10:16:04 +10:00
parent 22e8ce3eb3
commit f00f7f099f

View file

@ -313,8 +313,11 @@ class SimpleProcessPlayer(Player): # pylint: disable=abstract-method
if self._terminate_flag:
self._process.terminate()
self._process.wait(1)
if self._process.stdin:
self._process.stdin.close()
try:
if self._process.stdin:
self._process.stdin.close()
except Exception as e:
print("unable to close stdin:", e)
self._process = None
return
@ -323,8 +326,11 @@ class SimpleProcessPlayer(Player): # pylint: disable=abstract-method
self._process.wait(0.1)
if self._process.returncode != 0:
print(f"player got return code: {self._process.returncode}")
if self._process.stdin:
self._process.stdin.close()
try:
if self._process.stdin:
self._process.stdin.close()
except Exception as e:
print("unable to close stdin:", e)
self._process = None
return
except subprocess.TimeoutExpired: