Skip to content

Commit b82d752

Browse files
author
blank_name
committed
Don't try to update_state when duration is nil in the on_video_change event.
1 parent 682becf commit b82d752

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/thumbnailer_shared.lua

+4-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,10 @@ function Thumbnailer:on_start_file()
6868
end
6969

7070
function Thumbnailer:on_video_change(params)
71-
-- Gather a new state when we get proper video-dec-params and our state is empty
72-
if params ~= nil then
71+
local duration = mp.get_property_native("duration")
72+
-- Gather a new state when we have proper video-dec-params, duration
73+
-- and our state is empty
74+
if params ~= nil and duration ~= nil then
7375
if not self.state.ready then
7476
self:update_state()
7577
end

0 commit comments

Comments
 (0)