@@ -51,17 +51,17 @@ function binding.start_funscript_generator()
5151 local tmpFile = ofs .ExtensionDir () .. " /" .. tmpFileName
5252 local video = player .CurrentVideo ()
5353 local script = ofs .Script (scriptIdx )
54- local currentTimeMs = player .CurrentTime () * 1000
54+ local currentTime = player .CurrentTime ()
5555 local fps = player .FPS ()
5656
5757 print (" tmpFile: " , tmpFile )
5858 print (" video: " , video )
5959 print (" fps" , fps )
6060 print (" currentScriptIdx: " , scriptIdx )
61- print (" currentTimeMs : " , currentTimeMs )
61+ print (" currentTime : " , currentTime )
6262
63- local next_action , _ = script :closestActionAfter (currentTimeMs / 1000.0 )
64- if next_action and ( next_action .at * 1000 ) < (currentTimeMs + 500 ) then
63+ local next_action , _ = script :closestActionAfter (currentTime )
64+ if next_action and next_action .at < (currentTime + 0.5 ) then
6565 next_action , _ = script :closestActionAfter (next_action .at )
6666 end
6767
@@ -93,15 +93,15 @@ function binding.start_funscript_generator()
9393 end
9494
9595 table.insert (args , " -s" )
96- table.insert (args , tostring (currentTimeMs ))
96+ table.insert (args , tostring (math.floor ( currentTime * 1000 ) ))
9797 table.insert (args , " -i" )
9898 table.insert (args , video )
9999 table.insert (args , " -o" )
100100 table.insert (args , tmpFile )
101101
102102 if next_action then
103103 table.insert (args , " -e" )
104- table.insert (args , tostring (next_action .at * 1000.0 ))
104+ table.insert (args , tostring (math.floor ( next_action .at * 1000.0 ) ))
105105 end
106106
107107 print (" cmd: " , cmd )
0 commit comments