aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/main.lua b/main.lua
index 98a4ad1..21854df 100644
--- a/main.lua
+++ b/main.lua
@@ -21,10 +21,10 @@ local sub_needed = function ()
return false
end
- duration = tonumber(mp.get_property('duration'))
- if duration < 900 then -- duration is less than 15 minutes
+ duration = mp.get_property('duration')
+ if not duration or tonumber(duration) < 900 then
return false
- end
+ end -- ensure duration is less than 15 minutes
for _, v in pairs(mp.get_property_native('track-list')) do
if v['type'] == 'sub' then