fix: drag seeking crashing the UI during file loads

closes #305
This commit is contained in:
tomasklaen
2022-10-08 09:32:11 +02:00
parent e94f9bf290
commit a942a932c6

View File

@@ -2803,7 +2803,9 @@ end
---@param fast? boolean
function Timeline:set_from_cursor(fast)
mp.commandv('seek', self:get_time_at_x(cursor.x), fast and 'absolute+keyframes' or 'absolute+exact')
if state.time and state.duration then
mp.commandv('seek', self:get_time_at_x(cursor.x), fast and 'absolute+keyframes' or 'absolute+exact')
end
end
function Timeline:clear_thumbnail() mp.commandv('script-message-to', 'thumbfast', 'clear') end