From b031df2cdb26709a9b2f21ed7323dac5b9c3899b Mon Sep 17 00:00:00 2001 From: Etoh Date: Sat, 4 May 2013 18:51:20 +0200 Subject: [PATCH 1/3] vlc.py - Allow VLC_MAX_PORT to be set to the same value as VLC_MIN_PORT Avoids empty range ValueError --- syncplay/players/vlc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syncplay/players/vlc.py b/syncplay/players/vlc.py index edf5f67..edcb214 100644 --- a/syncplay/players/vlc.py +++ b/syncplay/players/vlc.py @@ -18,7 +18,7 @@ class VlcPlayer(BasePlayer): SLAVE_ARGS = ['--extraintf=luaintf','--lua-intf=syncplay'] random.seed() - vlcport = random.randrange(VLC_MIN_PORT, VLC_MAX_PORT) + vlcport = random.randrange(VLC_MIN_PORT, VLC_MAX_PORT) if (VLC_MIN_PORT < VLC_MAX_PORT) else VLC_MIN_PORT SLAVE_ARGS.append('--lua-config=syncplay={{port=\"{}\"}}'.format(str(vlcport))) def __init__(self, client, playerPath, filePath, args): @@ -213,4 +213,4 @@ class VlcPlayer(BasePlayer): def sendLine(self, line): if(self.connected): # print "send: {}".format(line) - self.push(line + "\n") \ No newline at end of file + self.push(line + "\n") From f85f876b0333bf6785d010c6ee21b3ef0b28b537 Mon Sep 17 00:00:00 2001 From: Etoh Date: Sat, 4 May 2013 18:54:23 +0200 Subject: [PATCH 2/3] Add VLC version checking code to vlc.py Complains if VLC version is less than 2.0.6 --- syncplay/players/vlc.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/syncplay/players/vlc.py b/syncplay/players/vlc.py index edcb214..e763a14 100644 --- a/syncplay/players/vlc.py +++ b/syncplay/players/vlc.py @@ -16,6 +16,7 @@ class VlcPlayer(BasePlayer): VLC_MIN_PORT = 10000 VLC_MAX_PORT = 55000 SLAVE_ARGS = ['--extraintf=luaintf','--lua-intf=syncplay'] + VLC_MIN_VERSION = "2.0.6" random.seed() vlcport = random.randrange(VLC_MIN_PORT, VLC_MAX_PORT) if (VLC_MIN_PORT < VLC_MAX_PORT) else VLC_MIN_PORT @@ -123,6 +124,9 @@ class VlcPlayer(BasePlayer): self._filename = value self._filenameAsk.set() elif (line[:16] == "VLC media player"): + vlc_version = line[17:22] + if (int(vlc_version.replace(".","")) < int(self.VLC_MIN_VERSION.replace(".",""))): + self._client.ui.showMessage(getMessage("en", "vlc-version-mismatch").format(str(vlc_version), str(self.VLC_MIN_VERSION))) self._vlcready.set() From c523b6272bcd95dd3dbd64d52b0380d3e74033ce Mon Sep 17 00:00:00 2001 From: Etoh Date: Sat, 4 May 2013 18:55:17 +0200 Subject: [PATCH 3/3] Add VLC version mismatch message text to messages.py --- syncplay/messages.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/syncplay/messages.py b/syncplay/messages.py index 2b66e6b..2a61251 100644 --- a/syncplay/messages.py +++ b/syncplay/messages.py @@ -49,6 +49,8 @@ en = { "commandlist-notification/help" : "\th - this help", "syncplay-version-notification" : "Syncplay version: {}", #syncplay.version "more-info-notification" : "More info available at: {}", #projectURL + + "vlc-version-mismatch": "Warning: You are running VLC version {}, but Syncplay is designed to run on VLC {} and above\n", # VLC version, VLC min version # Client prompts "enter-to-exit-prompt" : "Press enter to exit\n",