Fix VLC load file code so it actually plays, and be more stringent on old VLC versions as they randomly crash

This commit is contained in:
Et0h 2016-07-17 12:33:55 +01:00
parent 08eb9d24b1
commit 8307236b11
3 changed files with 7 additions and 6 deletions

View File

@ -5,7 +5,7 @@
Principal author: Etoh
Other contributors: DerGenaue, jb
Project: http://syncplay.pl/
Version: 0.2.9
Version: 0.3.0
Note:
* 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.2.9"
local connectorversion = "0.3.0"
local vlcversion = vlc.misc.version()
local durationdelay = 500000 -- Pause for get_duration command etc for increased reliability (uses microseconds)
local loopsleepduration = 2500 -- Pause for every event loop (uses microseconds)
@ -466,6 +466,7 @@ function load_file (filepath)
vlc.playlist.clear()
vlc.playlist.enqueue({{path=uri}})
vlc.playlist.next()
vlc.playlist.play()
return "load-file-attempted\n"
end
@ -532,8 +533,8 @@ function set_playstate(argument)
return errormsg
end
if string.sub(vlcversion,1,2) == "1." then
vlc.msg.err("This version of VLC is not known to support the Syncplay interface module. Please use VLC 2+.")
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+.")
quit_vlc()
else
l = vlc.net.listen_tcp(host, port)

View File

@ -1,4 +1,4 @@
version = '1.4.0'
milestone = 'Yoitsu'
release_number = '29'
release_number = '30'
projectURL = 'http://syncplay.pl/'

View File

@ -72,7 +72,7 @@ COMMANDS_AUTH = ['a','auth']
COMMANDS_TOGGLE = ['t','toggle']
MPC_MIN_VER = "1.6.4"
VLC_MIN_VERSION = "2.2.1"
VLC_INTERFACE_MIN_VERSION = "0.2.9"
VLC_INTERFACE_MIN_VERSION = "0.3.0"
VLC_LATENCY_ERROR_THRESHOLD = 2.0
MPV_UNRESPONSIVE_THRESHOLD = 60.0
CONTROLLED_ROOMS_MIN_VERSION = "1.3.0"