reduce the chances of a race condition in mplayer code

Not perfect, it may still happen.

https://anki.tenderapp.com/discussions/ankidesktop/39832-an-error-occurred-audio
This commit is contained in:
Damien Elmes 2020-03-23 19:15:32 +10:00
parent f889616ef1
commit 84eaf43525

View file

@ -393,6 +393,7 @@ class SimpleMplayerSlaveModePlayer(SimpleMplayerPlayer):
The trailing newline is automatically added."""
str_args = [str(x) for x in args]
if self._process:
self._process.stdin.write(" ".join(str_args).encode("utf8") + b"\n")
self._process.stdin.flush()