Fix for timeout on mpv eof
This commit is contained in:
parent
3719462e0c
commit
5914d884da
@ -500,8 +500,10 @@ class SyncplayClient(object):
|
||||
return True
|
||||
return self._globalPaused
|
||||
|
||||
def eofReportedByPlayer(self, filepath):
|
||||
self.playlist.eofReportedByPlayer(filepath)
|
||||
def eofReportedByPlayer(self):
|
||||
if self.playlist.notJustChangedPlaylist():
|
||||
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()
|
||||
@ -1966,11 +1968,6 @@ class SyncplayPlaylist():
|
||||
secondsSinceLastChange = time.time() - self._lastPlaylistIndexChange
|
||||
return secondsSinceLastChange > constants.PLAYLIST_LOAD_NEXT_FILE_TIME_FROM_END_THRESHOLD
|
||||
|
||||
def eofReportedByPlayer(self, filepath):
|
||||
if self.notJustChangedPlaylist():
|
||||
self._ui.showDebugMessage("Advancing to next item in playlist due to media player EOF report: {}".format(filepath))
|
||||
self.loadNextFileInPlaylist()
|
||||
|
||||
@needsSharedPlaylistsEnabled
|
||||
def loadNextFileInPlaylist(self):
|
||||
if self._notPlayingCurrentIndex():
|
||||
|
||||
@ -213,8 +213,8 @@ class MpvPlayer(BasePlayer):
|
||||
else:
|
||||
return self._position
|
||||
|
||||
def eofDetected(self, path):
|
||||
self._client.eofReportedByPlayer(path)
|
||||
def eofDetected(self):
|
||||
self._client.eofReportedByPlayer()
|
||||
|
||||
def _storePosition(self, value):
|
||||
if value is None:
|
||||
@ -423,14 +423,13 @@ class MpvPlayer(BasePlayer):
|
||||
|
||||
def _handleUnknownLine(self, line):
|
||||
self.mpvErrorCheck(line)
|
||||
if "<eof>" in line:
|
||||
line = line[5:-6]
|
||||
self.eofDetected(line)
|
||||
|
||||
if "<chat>" in line:
|
||||
line = line.replace(constants.MPV_INPUT_BACKSLASH_SUBSTITUTE_CHARACTER, "\\")
|
||||
self._listener.sendChat(line[6:-7])
|
||||
|
||||
if "<eof>" in line:
|
||||
self.eofDetected()
|
||||
|
||||
if "<paused=" in line and ", pos=" in line:
|
||||
update_string = line.replace(">", "<").replace("=", "<").replace(", ", "<").split("<")
|
||||
paused_update = update_string[2]
|
||||
|
||||
@ -297,9 +297,7 @@ chat_timer=mp.add_periodic_timer(TICK_INTERVAL, chat_update)
|
||||
|
||||
mp.observe_property('eof-reached', 'bool', function(e)
|
||||
if mp.get_property_native("eof-reached") == true then
|
||||
line = mp.get_property_native("path")
|
||||
line = line.gsub(line,"\\", "\\\\")
|
||||
mp.command('print-text "<eof>' .. line .. '</eof>"')
|
||||
mp.command('print-text "<eof>"')
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user