Use conf.fatal for fatal configuration errors
[ardour.git] / scripts / export_mp4chaps.lua
index 962ea759c2d59843414fa3657aecd74644bbe100..61c78c3a2f9b205733f36e9ee2799c9ab3d5e58f 100644 (file)
@@ -19,7 +19,7 @@ have to wait for the export.
 
 function factory (unused_params) return function ()
 
-       local fr = Session:frame_rate()
+       local fr = Session:sample_rate()
        local chaps = {}
 
        for l in Session:locations():list():iter() do
@@ -27,7 +27,7 @@ function factory (unused_params) return function ()
                if not l:is_mark() or string.find(name, "^xrun%d*$") then
                        goto next end
 
-               local t = l:start()
+               local t = l:start() - Session:current_start_sample()
                local h = math.floor(t / (3600*fr))
                local r = t - (h*3600*fr)
                local m = math.floor(r / (60*fr))