quick if stuck

This commit is contained in:
j 2023-11-08 23:46:07 +01:00
parent 4e04bec8ad
commit 60bd70704f
4 changed files with 5 additions and 9 deletions

View file

@ -1,6 +1,6 @@
[Desktop Entry]
Type=Application
Exec=/srv/pandora/t_for_time/player/player.py --mode main --playlist /srv/t_for_time/render/back.m3u
Exec=/srv/pandora/t_for_time/player/player.py --mode peer --playlist /srv/t_for_time/render/back.m3u
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true

View file

@ -1,6 +1,6 @@
[Desktop Entry]
Type=Application
Exec=/srv/pandora/t_for_time/player/player.py --mode peer --playlist /srv/t_for_time/render/front.m3u
Exec=/srv/pandora/t_for_time/player/player.py --mode main --playlist /srv/t_for_time/render/front.m3u
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true

View file

@ -5,7 +5,7 @@ Description=player
Type=simple
Restart=always
KillSignal=SIGINT
ExecStart=/srv/pandora/t_for_time/player/player.py --mode peer--playlist /srv/t_for_time/render/back.m3u
ExecStart=/srv/pandora/t_for_time/player/player.py --mode peer --playlist /srv/t_for_time/render/back.m3u
[Install]
WantedBy=default.target

View file

@ -77,13 +77,10 @@ class Sync(Thread):
self.read_position_main()
#self.adjust_position()
self.reload_playlist()
if self._tick and abs(time.time() - self._tick) > 10:
if self._tick and abs(time.time() - self._tick) > 60:
logger.error("player is stuck")
self._tick = 0
self.mpv.loadlist(self.playlist)
self.mpv.playlist_play_index(0)
self.mpv.pause = False
self.mpv.wait_until_playing()
self.quit()
def q_binding(self, *args):
self.stop()
@ -158,7 +155,6 @@ class Sync(Thread):
data = self.sock.recvfrom(1024)[0].decode().split(" ", 1)
except socket.timeout:
logger.error("failed to receive data from main")
return self.read_position_main()
else:
self.main.time_pos = float(data[0])
self.main.playlist_current_pos = int(data[1])