syncplay.lua: only check title if file open

This commit is contained in:
Etoh 2014-04-18 23:51:08 +01:00
parent b5767a8bcc
commit 2a736d613f
1 changed files with 13 additions and 10 deletions

View File

@ -244,16 +244,19 @@ function get_time()
end
function set_time ( timetoset)
local response, errormsg, realtime, titletrack
realtime = timetoset % titlemultiplier
oldtitle = tonumber(get_var("title"))
newtitle = (timetoset - realtime) / titlemultiplier
if oldtitle ~= newtitle and newtitle > -1 then
set_var("title", tonumber(newtitle))
end
errormsg = set_var("time", tonumber(realtime))
return errormsg
local input = vlc.object.input()
if input then
local response, errormsg, realtime, titletrack
realtime = timetoset % titlemultiplier
oldtitle = tonumber(get_var("title"))
newtitle = (timetoset - realtime) / titlemultiplier
if oldtitle ~= newtitle and newtitle > -1 then
set_var("title", tonumber(newtitle))
end
errormsg = set_var("time", tonumber(realtime))
return errormsg
else
return noinput
end
get_var("time")