better quit

This commit is contained in:
j 2017-10-27 22:53:44 +02:00
parent 569dd9a06d
commit fed99721d6
1 changed files with 13 additions and 9 deletions

View File

@ -14,11 +14,12 @@ logger = logging.getLogger('cdosea')
player = None
quit = False
def q_binding(*args):
global player
player.quit()
del player
quit = True
player.quit()
player = None
def main():
@ -61,13 +62,16 @@ def main():
pause_next = False
play_lights = True
while True:
if not quit and pause_next:
player.pause = True
pause_next = False
play_lights = False
elif not quit and player.path.decode().endswith('black.mp4'):
pause_next = True
play_lights = False
if not player:
break
if not quit:
if pause_next:
player.pause = True
pause_next = False
play_lights = False
elif player.path.decode().endswith('black.mp4'):
pause_next = True
play_lights = False
if play_lights and config.lights and player.path:
trigger_lights(player.path.decode())