vlc.py - Allow VLC_MAX_PORT to be set to the same value as VLC_MIN_PORT

Avoids empty range ValueError
This commit is contained in:
Etoh 2013-05-04 18:51:20 +02:00
parent 3aa56864f8
commit b031df2cdb

View File

@ -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")
self.push(line + "\n")