From f2faeb72c8ff779578b5cbc575cf8a737bf955e9 Mon Sep 17 00:00:00 2001 From: Etoh Date: Fri, 18 Apr 2014 11:12:43 +0100 Subject: [PATCH] syncplay.lua: Don't give new title w/ old time --- resources/lua/intf/syncplay.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/resources/lua/intf/syncplay.lua b/resources/lua/intf/syncplay.lua index 5821f7d..25bb3be 100644 --- a/resources/lua/intf/syncplay.lua +++ b/resources/lua/intf/syncplay.lua @@ -4,7 +4,7 @@ Author: Etoh Project: http://syncplay.pl/ - Version: 0.1.8 + Version: 0.1.9 Note: * This interface module is intended to be used in conjunction with Syncplay. @@ -85,8 +85,8 @@ else require "common" end -local connectorversion = "0.1.8" -local durationdelay = 500000 -- Pause for get_duration command for increased reliability +local connectorversion = "0.1.9" +local durationdelay = 500000 -- Pause for get_duration command etc for increased reliability local host = "localhost" local port @@ -109,6 +109,8 @@ local oldfilepath local oldinputstate local newfilepath local newinputstate +local oldtitle = 0 +local newtitle = 0 local running = true @@ -137,6 +139,11 @@ function detectchanges() notificationbuffer = notificationbuffer .. "filepath-change"..notificationmarker..msgterminator end + newtitle = get_var("title") + if newtitle ~= oldtitle and get_var("time") > 1 then + vlc.misc.mwait(vlc.misc.mdate() + durationdelay) -- Don't give new title with old time + end + oldtitle = newtitle notificationbuffer = notificationbuffer .. "playstate"..msgseperator..tostring(get_play_state())..msgterminator notificationbuffer = notificationbuffer .. "position"..msgseperator..tostring(get_time())..msgterminator else