[karaoke-split] gmatch is magic
This commit is contained in:
parent
3f84fc4914
commit
6ef9e2f765
|
@ -11,11 +11,8 @@ function split_line(subs, sel)
|
|||
d = 0
|
||||
|
||||
kduration = "{[^}]-\\[kK][fo]?(%d+)[^}]-}"
|
||||
_, iend, match = line:find(kduration)
|
||||
while match do
|
||||
for match in line:gmatch(kduration) do
|
||||
d = d + tonumber(match)
|
||||
line = line:sub(iend + 1) -- keep looking for more
|
||||
_, iend, match = line:find(kduration)
|
||||
end
|
||||
|
||||
return d * 10
|
||||
|
|
Loading…
Reference in a new issue