From c063369e3c9c0f534c5fa9c42968df062fce7d74 Mon Sep 17 00:00:00 2001 From: Etoh Date: Sun, 28 Mar 2021 20:18:56 +0100 Subject: [PATCH] Improve playlist advancement for VLC and mpv (#334) (#397) * Advance playlist on end of file in mpv and VLC * Update duration for streams to fix playlist advancement (#334) --- syncplay/client.py | 5 +++++ syncplay/constants.py | 4 ++-- syncplay/players/mpv.py | 7 ++++++- syncplay/players/vlc.py | 7 ++++++- syncplay/resources/lua/intf/syncplay.lua | 20 ++++++++++++++------ syncplay/resources/syncplayintf.lua | 9 ++++++++- 6 files changed, 41 insertions(+), 11 deletions(-) diff --git a/syncplay/client.py b/syncplay/client.py index bfc0320..d627a05 100755 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -500,6 +500,11 @@ class SyncplayClient(object): return True return self._globalPaused + def eofReportedByPlayer(self): + if self.playlist.notJustChangedPlaylist() and self.userlist.currentUser.file: + self.ui.showDebugMessage("Fixing file duration to allow for playlist advancement") + self.userlist.currentUser.file["duration"] = self._playerPosition + def updateFile(self, filename, duration, path): self.lastUpdatedFileTime = time.time() newPath = "" diff --git a/syncplay/constants.py b/syncplay/constants.py index 17cd8ef..91c1d87 100755 --- a/syncplay/constants.py +++ b/syncplay/constants.py @@ -131,7 +131,7 @@ COMMANDS_DELETE = ['delete', 'd', 'qd'] MPC_MIN_VER = "1.6.4" MPC_BE_MIN_VER = "1.5.2.3123" VLC_MIN_VERSION = "2.2.1" -VLC_INTERFACE_VERSION = "0.3.6" +VLC_INTERFACE_VERSION = "0.3.7" VLC_LATENCY_ERROR_THRESHOLD = 2.0 MPV_UNRESPONSIVE_THRESHOLD = 60.0 CONTROLLED_ROOMS_MIN_VERSION = "1.3.0" @@ -289,7 +289,7 @@ VLC_SLAVE_EXTRA_ARGS = getValueForOS({ MPV_SUPERSEDE_IF_DUPLICATE_COMMANDS = ["set_property time-pos ", "loadfile "] MPV_REMOVE_BOTH_IF_DUPLICATE_COMMANDS = ["cycle pause"] MPLAYER_ANSWER_REGEX = "^ANS_([a-zA-Z_-]+)=(.+)$|^(Exiting)\.\.\. \((.+)\)$" -VLC_ANSWER_REGEX = r"(?:^(?P[a-zA-Z_]+)(?:\: )?(?P.*))" +VLC_ANSWER_REGEX = r"(?:^(?P[a-zA-Z_-]+)(?:\: )?(?P.*))" UI_COMMAND_REGEX = r"^(?P[^\ ]+)(?:\ (?P.+))?" UI_OFFSET_REGEX = r"^(?:o|offset)\ ?(?P[/+-])?(?P