Skip to content

Commit

Permalink
Handle nil duration in get_thumbnail_count.
Browse files Browse the repository at this point in the history
  • Loading branch information
blank_name committed Mar 7, 2020
1 parent 2549fb6 commit b8138db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/thumbnailer_shared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,10 @@ end


function Thumbnailer:get_thumbnail_count(delta)
if delta == nil then
local file_duration = mp.get_property_native("duration")
if delta == nil or file_duration == nil then
return 0
end
local file_duration = mp.get_property_native("duration")

return math.ceil(file_duration / delta)
end
Expand Down

0 comments on commit b8138db

Please sign in to comment.