Merge pull request #109 from Pilotat/vlc3.0.0_fix

VLC version 3.0.0 uses times in microseconds
This commit is contained in:
Etoh 2016-08-14 20:09:07 +01:00 committed by GitHub
commit 9edfb8e1ab

View File

@ -86,6 +86,7 @@ You may also need to re-copy the syncplay.lua file when you update VLC.
local connectorversion = "0.3.0"
local vlcversion = vlc.misc.version()
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 loopsleepduration = 2500 -- Pause for every event loop (uses microseconds)
local quitcheckfrequency = 20 -- Check whether VLC has closed every X loops
@ -242,6 +243,10 @@ function get_var( vartoget, fallbackvar )
errormsg = noinput
end
if vlcmajorversion == 3 and vartoget == "time" then
response = response / 1000000
end
return response, errormsg
end
@ -252,6 +257,10 @@ function set_var(vartoset, varvalue)
local errormsg
local input = vlc.object.input()
if vlcmajorversion == 3 and vartoset == "time" then
varvalue = varvalue * 1000000
end
if input then
vlc.var.set(input,tostring(vartoset),varvalue)
else