handle interrupted system call errors on mplayer shutdown

This commit is contained in:
Damien Elmes 2009-06-15 06:57:36 +09:00
parent e578ffc721
commit fb8f2bd09f

View file

@ -164,7 +164,13 @@ def clearMplayerQueue():
def stopMplayer():
mplayerCond.acquire()
if mplayerManager.mplayer:
mplayerManager.mplayer.communicate("quit\n")
while 1:
try:
mplayerManager.mplayer.communicate("quit\n")
break
except OSError:
# osx throws these regularly
pass
mplayerManager.mplayer = -1
mplayerCond.notify()
mplayerCond.release()