mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
cleanup mplayer slave on exit
This commit is contained in:
parent
d67b4b2ed9
commit
9d8df81e11
1 changed files with 10 additions and 1 deletions
|
@ -8,7 +8,7 @@ Sound support
|
||||||
"""
|
"""
|
||||||
__docformat__ = 'restructuredtext'
|
__docformat__ = 'restructuredtext'
|
||||||
|
|
||||||
import re, sys, threading, time, subprocess, os, signal
|
import re, sys, threading, time, subprocess, os, signal, atexit
|
||||||
|
|
||||||
# Shared utils
|
# Shared utils
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
@ -160,8 +160,17 @@ def clearMplayerQueue():
|
||||||
mplayerQueue.append(None)
|
mplayerQueue.append(None)
|
||||||
mplayerCond.release()
|
mplayerCond.release()
|
||||||
|
|
||||||
|
def stopMplayer():
|
||||||
|
mplayerCond.acquire()
|
||||||
|
if mplayerManager.mplayer:
|
||||||
|
mplayerManager.mplayer.communicate("quit\n")
|
||||||
|
mplayerManager.mplayer = -1
|
||||||
|
mplayerCond.notify()
|
||||||
|
mplayerCond.release()
|
||||||
|
|
||||||
mplayerManager = MplayerMonitor()
|
mplayerManager = MplayerMonitor()
|
||||||
mplayerManager.start()
|
mplayerManager.start()
|
||||||
|
atexit.register(stopMplayer)
|
||||||
|
|
||||||
# PyAudio recording
|
# PyAudio recording
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
Loading…
Reference in a new issue