Merge pull request #109 from Pilotat/vlc3.0.0_fix
VLC version 3.0.0 uses times in microseconds
This commit is contained in:
commit
9edfb8e1ab
@ -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 connectorversion = "0.3.0"
|
||||||
local vlcversion = vlc.misc.version()
|
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 durationdelay = 500000 -- Pause for get_duration command etc for increased reliability (uses microseconds)
|
||||||
local loopsleepduration = 2500 -- Pause for every event loop (uses microseconds)
|
local loopsleepduration = 2500 -- Pause for every event loop (uses microseconds)
|
||||||
local quitcheckfrequency = 20 -- Check whether VLC has closed every X loops
|
local quitcheckfrequency = 20 -- Check whether VLC has closed every X loops
|
||||||
@ -242,6 +243,10 @@ 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
|
||||||
|
|
||||||
@ -252,6 +257,10 @@ 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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user