Disable creation of secondary MPV socket by default

This commit is contained in:
peelz 2024-04-08 14:06:34 -04:00
parent 0a9700058e
commit 72d013e503

View File

@ -375,7 +375,7 @@ class MpvPlayer(BasePlayer):
self._listener.sendLine(['loadfile', filePath], notReadyAfterThis=True) self._listener.sendLine(['loadfile', filePath], notReadyAfterThis=True)
def setFeatures(self, featureList): def setFeatures(self, featureList):
self.sendMpvOptions() self._sendMpvOptions()
def setPosition(self, value): def setPosition(self, value):
if value < constants.DO_NOT_RESET_POSITION_THRESHOLD and self._recentlyReset(): if value < constants.DO_NOT_RESET_POSITION_THRESHOLD and self._recentlyReset():
@ -408,7 +408,7 @@ class MpvPlayer(BasePlayer):
self._storePosition(0) self._storePosition(0)
# TO TRY: self._listener.setReadyToSend(False) # TO TRY: self._listener.setReadyToSend(False)
def sendMpvOptions(self): def _sendMpvOptions(self):
options = [] options = []
for option in constants.MPV_SYNCPLAYINTF_OPTIONS_TO_SEND: for option in constants.MPV_SYNCPLAYINTF_OPTIONS_TO_SEND:
options.append("{}={}".format(option, self._client._config[option])) options.append("{}={}".format(option, self._client._config[option]))
@ -420,8 +420,9 @@ class MpvPlayer(BasePlayer):
options_string = ", ".join(options) options_string = ", ".join(options)
self._listener.sendLine(["script-message-to", "syncplayintf", "set_syncplayintf_options", options_string]) self._listener.sendLine(["script-message-to", "syncplayintf", "set_syncplayintf_options", options_string])
self._setOSDPosition() self._setOSDPosition()
publicIPCSocket = self._listener.mpv_arguments.get("input-ipc-server") if self._listener.mpv_arguments.get("input-ipc-server") else "mpvSyncplaySocket" socketPath = self._listener.mpv_arguments.get("input-ipc-server")
self._setProperty("input-ipc-server", publicIPCSocket) if socketPath is not None:
self._setProperty("input-ipc-server", socketPath)
def _handleUnknownLine(self, line): def _handleUnknownLine(self, line):
self.mpvErrorCheck(line) self.mpvErrorCheck(line)
@ -449,7 +450,7 @@ class MpvPlayer(BasePlayer):
#self._client.ui.showDebugMessage("{} = {} / {}".format(update_string, paused_update, position_update)) #self._client.ui.showDebugMessage("{} = {} / {}".format(update_string, paused_update, position_update))
if "<get_syncplayintf_options>" in line: if "<get_syncplayintf_options>" in line:
self.sendMpvOptions() self._sendMpvOptions()
if line == "<SyncplayUpdateFile>" or "Playing:" in line: if line == "<SyncplayUpdateFile>" or "Playing:" in line:
self._client.ui.showDebugMessage("Not ready to send due to <SyncplayUpdateFile>") self._client.ui.showDebugMessage("Not ready to send due to <SyncplayUpdateFile>")