summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-08-26 15:41:20 +0200
committerRobin Gareus <robin@gareus.org>2017-08-26 15:42:14 +0200
commitd190ad7904fa75fc27dda4d7415acfe65e2c501c (patch)
tree1abe5427212298dd530787ad3dc9640fc137cf6b /scripts
parent8c556fcbdc3e054fc34dcb19405b6f2e0c52e4e8 (diff)
mp4chaps Lua script: don't clutter global environment
Diffstat (limited to 'scripts')
-rw-r--r--scripts/export_mp4chaps.lua18
1 files changed, 9 insertions, 9 deletions
diff --git a/scripts/export_mp4chaps.lua b/scripts/export_mp4chaps.lua
index a58e678874..962ea759c2 100644
--- a/scripts/export_mp4chaps.lua
+++ b/scripts/export_mp4chaps.lua
@@ -19,22 +19,22 @@ have to wait for the export.
function factory (unused_params) return function ()
- fr = Session:frame_rate()
- chaps = {}
+ local fr = Session:frame_rate()
+ local chaps = {}
for l in Session:locations():list():iter() do
- name = l:name()
+ local name = l:name()
if not l:is_mark() or string.find(name, "^xrun%d*$") then
goto next end
- t = l:start()
- h = math.floor(t / (3600*fr))
- r = t - (h*3600*fr)
- m = math.floor(r / (60*fr))
+ local t = l:start()
+ local h = math.floor(t / (3600*fr))
+ local r = t - (h*3600*fr)
+ local m = math.floor(r / (60*fr))
r = r - m*60*fr
- s = math.floor(r / fr)
+ local s = math.floor(r / fr)
r = r - s*fr
- ms = math.floor(r*1000/fr)
+ local ms = math.floor(r*1000/fr)
table.insert(chaps, string.format("%02d:%02d:%02d.%03d %s\n", h, m, s, ms, name))
::next::
end