Handle VLC 3's lack of Syncplay support
This commit is contained in:
parent
80a1f2e546
commit
351024fcaa
@ -5,7 +5,7 @@
|
|||||||
Principal author: Etoh
|
Principal author: Etoh
|
||||||
Other contributors: DerGenaue, jb, Pilotat
|
Other contributors: DerGenaue, jb, Pilotat
|
||||||
Project: http://syncplay.pl/
|
Project: http://syncplay.pl/
|
||||||
Version: 0.3.1
|
Version: 0.3.2
|
||||||
|
|
||||||
Note:
|
Note:
|
||||||
* This interface module is intended to be used in conjunction with Syncplay.
|
* This interface module is intended to be used in conjunction with Syncplay.
|
||||||
@ -84,7 +84,7 @@ You may also need to re-copy the syncplay.lua file when you update VLC.
|
|||||||
|
|
||||||
--]==========================================================================]
|
--]==========================================================================]
|
||||||
|
|
||||||
local connectorversion = "0.3.1"
|
local connectorversion = "0.3.2"
|
||||||
local vlcversion = vlc.misc.version()
|
local vlcversion = vlc.misc.version()
|
||||||
local vlcmajorversion = tonumber(vlcversion:sub(1,1)) -- get the major version of VLC
|
local vlcmajorversion = tonumber(vlcversion:sub(1,1)) -- get the major version of VLC
|
||||||
local durationdelay = 500000 -- Pause for get_duration command etc for increased reliability (uses microseconds)
|
local durationdelay = 500000 -- Pause for get_duration command etc for increased reliability (uses microseconds)
|
||||||
@ -122,6 +122,15 @@ local l
|
|||||||
|
|
||||||
local running = true
|
local running = true
|
||||||
|
|
||||||
|
if vlcmajorversion == 3 then
|
||||||
|
-- VLC 3 does not currently support syncplay
|
||||||
|
running = false
|
||||||
|
vlc.msg.err("This version of VLC does not support Syncplay. Please use VLC 2.2.1+ or an alternative media player. VLC 3 does not support Syncplay.")
|
||||||
|
while true do
|
||||||
|
vlc.misc.quit()
|
||||||
|
vlc.misc.mwait(vlc.misc.mdate()+100000)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function radixsafe_tonumber(str)
|
function radixsafe_tonumber(str)
|
||||||
-- Version of tonumber that works with any radix character (but not thousand seperators)
|
-- Version of tonumber that works with any radix character (but not thousand seperators)
|
||||||
@ -243,10 +252,6 @@ function get_var( vartoget, fallbackvar )
|
|||||||
errormsg = noinput
|
errormsg = noinput
|
||||||
end
|
end
|
||||||
|
|
||||||
if vlcmajorversion == 3 and vartoget == "time" then
|
|
||||||
response = response / 1000000
|
|
||||||
end
|
|
||||||
|
|
||||||
return response, errormsg
|
return response, errormsg
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -257,10 +262,6 @@ function set_var(vartoset, varvalue)
|
|||||||
local errormsg
|
local errormsg
|
||||||
local input = vlc.object.input()
|
local input = vlc.object.input()
|
||||||
|
|
||||||
if vlcmajorversion == 3 and vartoset == "time" then
|
|
||||||
varvalue = varvalue * 1000000
|
|
||||||
end
|
|
||||||
|
|
||||||
if input then
|
if input then
|
||||||
vlc.var.set(input,tostring(vartoset),varvalue)
|
vlc.var.set(input,tostring(vartoset),varvalue)
|
||||||
else
|
else
|
||||||
@ -543,9 +544,9 @@ function set_playstate(argument)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if string.sub(vlcversion,1,2) == "1." or string.sub(vlcversion,1,3) == "2.0" or string.sub(vlcversion,1,3) == "2.1" or string.sub(vlcversion,1,5) == "2.2.0" then
|
if string.sub(vlcversion,1,2) == "1." or string.sub(vlcversion,1,3) == "2.0" or string.sub(vlcversion,1,3) == "2.1" or string.sub(vlcversion,1,5) == "2.2.0" then
|
||||||
vlc.msg.err("This version of VLC does not support Syncplay. Please use VLC 2.2.1+.")
|
vlc.msg.err("This version of VLC does not support Syncplay. Please use VLC 2.2.1+ or an alternative media player. VLC 3 does not support Syncplay.")
|
||||||
quit_vlc()
|
quit_vlc()
|
||||||
else
|
elseif vlcmajorversion ~= 3 then
|
||||||
l = vlc.net.listen_tcp(host, port)
|
l = vlc.net.listen_tcp(host, port)
|
||||||
vlc.msg.info("Hosting Syncplay interface on port: "..port)
|
vlc.msg.info("Hosting Syncplay interface on port: "..port)
|
||||||
end
|
end
|
||||||
@ -620,4 +621,4 @@ while running == true do
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@ -72,7 +72,7 @@ COMMANDS_AUTH = ['a','auth']
|
|||||||
COMMANDS_TOGGLE = ['t','toggle']
|
COMMANDS_TOGGLE = ['t','toggle']
|
||||||
MPC_MIN_VER = "1.6.4"
|
MPC_MIN_VER = "1.6.4"
|
||||||
VLC_MIN_VERSION = "2.2.1"
|
VLC_MIN_VERSION = "2.2.1"
|
||||||
VLC_INTERFACE_MIN_VERSION = "0.3.0"
|
VLC_INTERFACE_MIN_VERSION = "0.3.2"
|
||||||
VLC_LATENCY_ERROR_THRESHOLD = 2.0
|
VLC_LATENCY_ERROR_THRESHOLD = 2.0
|
||||||
MPV_UNRESPONSIVE_THRESHOLD = 60.0
|
MPV_UNRESPONSIVE_THRESHOLD = 60.0
|
||||||
CONTROLLED_ROOMS_MIN_VERSION = "1.3.0"
|
CONTROLLED_ROOMS_MIN_VERSION = "1.3.0"
|
||||||
|
|||||||
@ -92,8 +92,8 @@ de = {
|
|||||||
"language-changed-msgbox-label" : u"Die Sprache wird geändert, wenn du Syncplay neu startest.",
|
"language-changed-msgbox-label" : u"Die Sprache wird geändert, wenn du Syncplay neu startest.",
|
||||||
"promptforupdate-label" : u"Soll Syncplay regelmäßig nach Updates suchen?",
|
"promptforupdate-label" : u"Soll Syncplay regelmäßig nach Updates suchen?",
|
||||||
|
|
||||||
"vlc-version-mismatch": u"Warnung: Du nutzt VLC Version {}, aber Syncplay wurde für VLC ab Version {} entwickelt.", # VLC version, VLC min version
|
"vlc-version-mismatch": u"This version of VLC does not support Syncplay. VLC {}+ supports Syncplay but VLC 3 does not. Please use an alternative media player.", # VLC min version # TODO: Translate
|
||||||
"vlc-interface-version-mismatch": u"Warnung: Du nutzt Version {} des VLC-Syncplay Interface-Moduls, Syncplay benötigt aber mindestens Version {}.", # VLC interface version, VLC interface min version
|
"vlc-interface-version-mismatch": u"Du nutzt Version {} des VLC-Syncplay Interface-Moduls, Syncplay benötigt aber mindestens Version {}. In der Syncplay-Anleitung unter http://syncplay.pl/guide/ [Englisch] findest du Details zur Installation des syncplay.lua-Skripts.", # VLC interface version, VLC interface min version
|
||||||
"vlc-interface-oldversion-warning": u"Warnung: Es ist eine alte Version des Syncplay Interface-Moduls für VLC im VLC-Verzeichnis installiert. In der Syncplay-Anleitung unter http://syncplay.pl/guide/ [Englisch] findest du Details zur Installation des syncplay.lua-Skripts.",
|
"vlc-interface-oldversion-warning": u"Warnung: Es ist eine alte Version des Syncplay Interface-Moduls für VLC im VLC-Verzeichnis installiert. In der Syncplay-Anleitung unter http://syncplay.pl/guide/ [Englisch] findest du Details zur Installation des syncplay.lua-Skripts.",
|
||||||
"vlc-interface-not-installed": u"Warnung: Es wurde kein Syncplay Interface-Modul für VLC im VLC-Verzeichnis gefunden. Daher wird, wenn du VLC 2.0 nutzt, die syncplay.lua die mit Syncplay mitgeliefert wurde, verwendet. Dies bedeutet allerdings, dass keine anderen Interface-Skripts und Erweiterungen geladen werden. In der Syncplay-Anleitung unter http://syncplay.pl/guide/ [Englisch] findest du Details zur Installation des syncplay.lua-Skripts.",
|
"vlc-interface-not-installed": u"Warnung: Es wurde kein Syncplay Interface-Modul für VLC im VLC-Verzeichnis gefunden. Daher wird, wenn du VLC 2.0 nutzt, die syncplay.lua die mit Syncplay mitgeliefert wurde, verwendet. Dies bedeutet allerdings, dass keine anderen Interface-Skripts und Erweiterungen geladen werden. In der Syncplay-Anleitung unter http://syncplay.pl/guide/ [Englisch] findest du Details zur Installation des syncplay.lua-Skripts.",
|
||||||
"media-player-latency-warning": u"Warnung: Der Mediaplayer brauchte {} Sekunden zum Antworten. Wenn Probleme bei der Synchronisation auftreten, schließe bitte andere Anwendungen, um Ressourcen freizugeben. Sollte das nicht funktionieren, versuche es mit einem anderen Media-Player.", # Seconds to respond
|
"media-player-latency-warning": u"Warnung: Der Mediaplayer brauchte {} Sekunden zum Antworten. Wenn Probleme bei der Synchronisation auftreten, schließe bitte andere Anwendungen, um Ressourcen freizugeben. Sollte das nicht funktionieren, versuche es mit einem anderen Media-Player.", # Seconds to respond
|
||||||
|
|||||||
@ -92,8 +92,8 @@ en = {
|
|||||||
"language-changed-msgbox-label" : "Language will be changed when you run Syncplay.",
|
"language-changed-msgbox-label" : "Language will be changed when you run Syncplay.",
|
||||||
"promptforupdate-label" : u"Is it okay for Syncplay to automatically check for updates from time to time?",
|
"promptforupdate-label" : u"Is it okay for Syncplay to automatically check for updates from time to time?",
|
||||||
|
|
||||||
"vlc-version-mismatch": "Warning: You are running VLC version {}, but Syncplay is designed to run on VLC {} and above.", # VLC version, VLC min version
|
"vlc-version-mismatch": u"This version of VLC does not support Syncplay. VLC {}+ supports Syncplay but VLC 3 does not. Please use an alternative media player.", # VLC min version
|
||||||
"vlc-interface-version-mismatch": "Warning: You are running version {} of the Syncplay interface module for VLC, but Syncplay is designed to run with version {} and above.", # VLC interface version, VLC interface min version
|
"vlc-interface-version-mismatch": "You are running version {} of the Syncplay interface module for VLC, but Syncplay is designed to run with version {} and above. Please refer to the Syncplay User Guide at http://syncplay.pl/guide/ for instructions on how to install syncplay.lua.", # VLC interface version, VLC interface min version
|
||||||
"vlc-interface-oldversion-warning": "Warning: Syncplay detected that an old version version of the Syncplay interface module for VLC was installed in the VLC directory. Please refer to the Syncplay User Guide at http://syncplay.pl/guide/ for instructions on how to install syncplay.lua.",
|
"vlc-interface-oldversion-warning": "Warning: Syncplay detected that an old version version of the Syncplay interface module for VLC was installed in the VLC directory. Please refer to the Syncplay User Guide at http://syncplay.pl/guide/ for instructions on how to install syncplay.lua.",
|
||||||
"vlc-interface-not-installed": "Warning: The Syncplay interface module for VLC was not found in the VLC directory. As such, if you are running VLC 2.0 then VLC will use the syncplay.lua module contained within the Syncplay directory, but this will mean that other custom interface scripts and extensions will not work. Please refer to the Syncplay User Guide at http://syncplay.pl/guide/ for instructions on how to install syncplay.lua.",
|
"vlc-interface-not-installed": "Warning: The Syncplay interface module for VLC was not found in the VLC directory. As such, if you are running VLC 2.0 then VLC will use the syncplay.lua module contained within the Syncplay directory, but this will mean that other custom interface scripts and extensions will not work. Please refer to the Syncplay User Guide at http://syncplay.pl/guide/ for instructions on how to install syncplay.lua.",
|
||||||
"media-player-latency-warning": u"Warning: The media player took {} seconds to respond. If you experience syncing issues then close applications to free up system resources, and if that doesn't work then try a different media player.", # Seconds to respond
|
"media-player-latency-warning": u"Warning: The media player took {} seconds to respond. If you experience syncing issues then close applications to free up system resources, and if that doesn't work then try a different media player.", # Seconds to respond
|
||||||
|
|||||||
@ -92,8 +92,8 @@ ru = {
|
|||||||
"language-changed-msgbox-label" : u"Язык переключится при следующем запуске SYncplay.",
|
"language-changed-msgbox-label" : u"Язык переключится при следующем запуске SYncplay.",
|
||||||
"promptforupdate-label" : u"Вы не против, если Syncplay будет автоматически изредка проверять наличие обновлений?",
|
"promptforupdate-label" : u"Вы не против, если Syncplay будет автоматически изредка проверять наличие обновлений?",
|
||||||
|
|
||||||
"vlc-version-mismatch" : u"Внимание: Вы используете VLC устаревшей версии {}. К сожалению, Syncplay способен работать с VLC {} и выше.", # VLC version, VLC min version
|
"vlc-version-mismatch": u"This version of VLC does not support Syncplay. VLC {}+ supports Syncplay but VLC 3 does not. Please use an alternative media player.", # VLC min version # TODO: Translate
|
||||||
"vlc-interface-version-mismatch" : u"Внимание: В используете модуль интерфейса Syncplay устаревшей версии {} для VLC. К сожалению, Syncplay способен работать с версией {} и выше.", # VLC interface version, VLC interface min version
|
"vlc-interface-version-mismatch" : u"В используете модуль интерфейса Syncplay устаревшей версии {} для VLC. К сожалению, Syncplay способен работать с версией {} и выше. Пожалуйста, обратитесь к Руководству Пользователя Syncplay (http://syncplay.pl/guide/) за инструкциями о том, как установить syncplay.lua.", # VLC interface version, VLC interface min version
|
||||||
"vlc-interface-oldversion-warning" : u"Внимание: Syncplay обнаружил, что старая версия модуля интерфейса Syncplay для VLC уже установлена в директорию VLC. Пожалуйста, обратитесь к Руководству Пользователя Syncplay (http://syncplay.pl/guide/) за инструкциями о том, как установить syncplay.lua.",
|
"vlc-interface-oldversion-warning" : u"Внимание: Syncplay обнаружил, что старая версия модуля интерфейса Syncplay для VLC уже установлена в директорию VLC. Пожалуйста, обратитесь к Руководству Пользователя Syncplay (http://syncplay.pl/guide/) за инструкциями о том, как установить syncplay.lua.",
|
||||||
"vlc-interface-not-installed" : u"Внимание: Модуль интерфейса Syncplay для VLC не обнаружен в директории VLC. По существу, если Вы используете VLC 2.0, то VLC будет использовать модуль syncplay.lua из директории Syncplay, но в таком случае другие пользовательские скрипты и расширения интерфейса не будут работать. Пожалуйста, обратитесь к Руководству Пользователя Syncplay (http://syncplay.pl/guide/) за инструкциями о том, как установить syncplay.lua.",
|
"vlc-interface-not-installed" : u"Внимание: Модуль интерфейса Syncplay для VLC не обнаружен в директории VLC. По существу, если Вы используете VLC 2.0, то VLC будет использовать модуль syncplay.lua из директории Syncplay, но в таком случае другие пользовательские скрипты и расширения интерфейса не будут работать. Пожалуйста, обратитесь к Руководству Пользователя Syncplay (http://syncplay.pl/guide/) за инструкциями о том, как установить syncplay.lua.",
|
||||||
"media-player-latency-warning": u"Внимание: У Вашего проигрывателя слишком большой отклик ({} секунд). Если Вы замечаете проблемы с синхронизацией, то закройте ресурсоемкие приложения, а если это не помогло - попробуйте другой проигрыватель.", # Seconds to respond
|
"media-player-latency-warning": u"Внимание: У Вашего проигрывателя слишком большой отклик ({} секунд). Если Вы замечаете проблемы с синхронизацией, то закройте ресурсоемкие приложения, а если это не помогло - попробуйте другой проигрыватель.", # Seconds to respond
|
||||||
|
|||||||
@ -50,19 +50,23 @@ class VlcPlayer(BasePlayer):
|
|||||||
self._pausedAsk = threading.Event()
|
self._pausedAsk = threading.Event()
|
||||||
self._vlcready = threading.Event()
|
self._vlcready = threading.Event()
|
||||||
self._vlcclosed = threading.Event()
|
self._vlcclosed = threading.Event()
|
||||||
|
self._listener = None
|
||||||
try:
|
try:
|
||||||
self._listener = self.__Listener(self, playerPath, filePath, args, self._vlcready, self._vlcclosed)
|
self._listener = self.__Listener(self, playerPath, filePath, args, self._vlcready, self._vlcclosed)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self._client.ui.showErrorMessage(getMessage("vlc-failed-connection"), True)
|
self._client.ui.showErrorMessage(getMessage("vlc-failed-connection"), True)
|
||||||
self.reactor.callFromThread(self._client.stop, True,)
|
self.reactor.callFromThread(self._client.stop, True,)
|
||||||
return
|
return
|
||||||
self._listener.setDaemon(True)
|
try:
|
||||||
self._listener.start()
|
self._listener.setDaemon(True)
|
||||||
if not self._vlcready.wait(constants.VLC_OPEN_MAX_WAIT_TIME):
|
self._listener.start()
|
||||||
self._vlcready.set()
|
if not self._vlcready.wait(constants.VLC_OPEN_MAX_WAIT_TIME):
|
||||||
self._client.ui.showErrorMessage(getMessage("vlc-failed-connection"), True)
|
self._vlcready.set()
|
||||||
self.reactor.callFromThread(self._client.stop, True,)
|
self._client.ui.showErrorMessage(getMessage("vlc-failed-connection"), True)
|
||||||
self.reactor.callFromThread(self._client.initPlayer, self,)
|
self.reactor.callFromThread(self._client.stop, True,)
|
||||||
|
self.reactor.callFromThread(self._client.initPlayer, self,)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
def _fileUpdateClearEvents(self):
|
def _fileUpdateClearEvents(self):
|
||||||
self._durationAsk.clear()
|
self._durationAsk.clear()
|
||||||
@ -200,7 +204,7 @@ class VlcPlayer(BasePlayer):
|
|||||||
elif line.startswith("vlc-version: "):
|
elif line.startswith("vlc-version: "):
|
||||||
vlc_version = line.split(': ')[1].replace(' ','-').split('-')[0]
|
vlc_version = line.split(': ')[1].replace(' ','-').split('-')[0]
|
||||||
if not utils.meetsMinVersion(vlc_version, constants.VLC_MIN_VERSION):
|
if not utils.meetsMinVersion(vlc_version, constants.VLC_MIN_VERSION):
|
||||||
self._client.ui.showErrorMessage(getMessage("vlc-version-mismatch").format(str(vlc_version), str(constants.VLC_MIN_VERSION)))
|
self._client.ui.showErrorMessage(getMessage("vlc-version-mismatch").format(constants.VLC_MIN_VERSION))
|
||||||
self._vlcready.set()
|
self._vlcready.set()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -247,22 +251,27 @@ class VlcPlayer(BasePlayer):
|
|||||||
if os.access(path, os.X_OK):
|
if os.access(path, os.X_OK):
|
||||||
return path
|
return path
|
||||||
|
|
||||||
def drop(self):
|
def drop(self, dropErrorMessage=None):
|
||||||
self._vlcclosed.clear()
|
if self._listener:
|
||||||
self._listener.sendLine('close-vlc')
|
self._vlcclosed.clear()
|
||||||
self._vlcclosed.wait()
|
self._listener.sendLine('close-vlc')
|
||||||
|
self._vlcclosed.wait()
|
||||||
self._durationAsk.set()
|
self._durationAsk.set()
|
||||||
self._filenameAsk.set()
|
self._filenameAsk.set()
|
||||||
self._pathAsk.set()
|
self._pathAsk.set()
|
||||||
self._positionAsk.set()
|
self._positionAsk.set()
|
||||||
self._vlcready.set()
|
self._vlcready.set()
|
||||||
self._pausedAsk.set()
|
self._pausedAsk.set()
|
||||||
|
if dropErrorMessage:
|
||||||
|
self.reactor.callFromThread(self._client.ui.showErrorMessage, dropErrorMessage, True)
|
||||||
self.reactor.callFromThread(self._client.stop, False,)
|
self.reactor.callFromThread(self._client.stop, False,)
|
||||||
|
|
||||||
class __Listener(threading.Thread, asynchat.async_chat):
|
class __Listener(threading.Thread, asynchat.async_chat):
|
||||||
def __init__(self, playerController, playerPath, filePath, args, vlcReady, vlcClosed):
|
def __init__(self, playerController, playerPath, filePath, args, vlcReady, vlcClosed):
|
||||||
self.__playerController = playerController
|
self.__playerController = playerController
|
||||||
self.requestedVLCVersion = False
|
self.requestedVLCVersion = False
|
||||||
|
self.vlcHasResponded = False
|
||||||
|
self.oldIntfVersion = None
|
||||||
call = [playerPath]
|
call = [playerPath]
|
||||||
if filePath:
|
if filePath:
|
||||||
if utils.isASCII(filePath):
|
if utils.isASCII(filePath):
|
||||||
@ -281,7 +290,7 @@ class VlcPlayer(BasePlayer):
|
|||||||
if utils.meetsMinVersion(interface_version, constants.VLC_INTERFACE_MIN_VERSION):
|
if utils.meetsMinVersion(interface_version, constants.VLC_INTERFACE_MIN_VERSION):
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
playerController._client.ui.showErrorMessage(getMessage("vlc-interface-oldversion-warning"))
|
self.oldIntfVersion = line[26:31]
|
||||||
return False
|
return False
|
||||||
playerController._client.ui.showErrorMessage(getMessage("vlc-interface-not-installed"))
|
playerController._client.ui.showErrorMessage(getMessage("vlc-interface-not-installed"))
|
||||||
return False
|
return False
|
||||||
@ -316,26 +325,32 @@ class VlcPlayer(BasePlayer):
|
|||||||
|
|
||||||
self._vlcready = vlcReady
|
self._vlcready = vlcReady
|
||||||
self._vlcclosed = vlcClosed
|
self._vlcclosed = vlcClosed
|
||||||
self.__process = subprocess.Popen(call, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
|
|
||||||
for line in iter(self.__process.stderr.readline, ''):
|
if self.oldIntfVersion:
|
||||||
if "[syncplay]" in line:
|
self.__playerController.drop(getMessage("vlc-interface-version-mismatch").format(self.oldIntfVersion,constants.VLC_INTERFACE_MIN_VERSION))
|
||||||
if "Listening on host" in line:
|
|
||||||
break
|
else:
|
||||||
if "Hosting Syncplay" in line:
|
self.__process = subprocess.Popen(call, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
|
||||||
break
|
for line in iter(self.__process.stderr.readline, ''):
|
||||||
elif "Couldn't find lua interface" in line:
|
self.vlcHasResponded = True
|
||||||
playerController._client.ui.showErrorMessage(getMessage("vlc-failed-noscript").format(line), True)
|
if "[syncplay]" in line:
|
||||||
break
|
if "Listening on host" in line:
|
||||||
elif "lua interface error" in line:
|
break
|
||||||
playerController._client.ui.showErrorMessage(getMessage("media-player-error").format(line), True)
|
if "Hosting Syncplay" in line:
|
||||||
break
|
break
|
||||||
self.__process.stderr = None
|
elif "Couldn't find lua interface" in line:
|
||||||
threading.Thread.__init__(self, name="VLC Listener")
|
playerController._client.ui.showErrorMessage(getMessage("vlc-failed-noscript").format(line), True)
|
||||||
asynchat.async_chat.__init__(self)
|
break
|
||||||
self.set_terminator("\n")
|
elif "lua interface error" in line:
|
||||||
self._ibuffer = []
|
playerController._client.ui.showErrorMessage(getMessage("media-player-error").format(line), True)
|
||||||
self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
|
break
|
||||||
self._sendingData = threading.Lock()
|
self.__process.stderr = None
|
||||||
|
threading.Thread.__init__(self, name="VLC Listener")
|
||||||
|
asynchat.async_chat.__init__(self)
|
||||||
|
self.set_terminator("\n")
|
||||||
|
self._ibuffer = []
|
||||||
|
self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
|
self._sendingData = threading.Lock()
|
||||||
|
|
||||||
def initiate_send(self):
|
def initiate_send(self):
|
||||||
with self._sendingData:
|
with self._sendingData:
|
||||||
@ -355,7 +370,10 @@ class VlcPlayer(BasePlayer):
|
|||||||
|
|
||||||
def handle_close(self):
|
def handle_close(self):
|
||||||
asynchat.async_chat.handle_close(self)
|
asynchat.async_chat.handle_close(self)
|
||||||
self.__playerController.drop()
|
if self.vlcHasResponded:
|
||||||
|
self.__playerController.drop()
|
||||||
|
else:
|
||||||
|
self.__playerController.drop(getMessage("vlc-version-mismatch").format(constants.VLC_MIN_VERSION))
|
||||||
|
|
||||||
def found_terminator(self):
|
def found_terminator(self):
|
||||||
self.__playerController.lineReceived("".join(self._ibuffer))
|
self.__playerController.lineReceived("".join(self._ibuffer))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user