Skip to content

Instantly share code, notes, and snippets.

@bitingsock
bitingsock / speed-between-subs.lua
Last active October 1, 2023 06:28
Increases playback speed if a subtitle has not been displayed; resumes normal speed when a new subtitle is shown
---user settings---
local WaitTime = 0.1 --how long until we try to enter "fast" mode
local lookAhead = 5 --how far ahead to look for subtitles when trying to enter "fast" mode
local fast = 6 --how fast "fast" mode is by default
local rewind = 0.2 --how far to rewind when entering normal mode; note that if this is more than or equal to WaitTime + lookAhead you will probably enter an infinite loop
---
local searchtimer
local checktimer
local waitTimer
local normal = mp.get_property("speed")