Properly handle delayed subtitles

Delayed subtitles where working properly for negative values. Positive delay values wheren't handled correctly.
This commit is contained in:
zenyd 2017-09-14 20:27:40 +02:00
parent 087b031e75
commit f428b3f6b3
1 changed files with 2 additions and 1 deletions

View File

@ -19,7 +19,8 @@ function check_should_speedup()
subdelay = mp.get_property_native("sub-delay")
mp.command("no-osd set sub-visibility no")
mp.command("no-osd sub-step 1")
nextsub = math.abs(mp.get_property_native("sub-delay"))-math.abs(subdelay)
nextsubdelay = mp.get_property_native("sub-delay")
nextsub = subdelay - nextsubdelay
--print("nextsub in seconds "..nextsub)
mp.set_property("sub-delay", subdelay)
mp.command("no-osd set sub-visibility yes")