Skip to content

Commit 1fe2606

Browse files
authored
Add files via upload
1 parent fdb2779 commit 1fe2606

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

mpv-sub_not_forced.lua

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
function select_not_forced_subtitle()
2+
local last_sub = nil
3+
for i, sub in ipairs(mp.get_property_native("track-list")) do
4+
if sub.type == "sub" and not sub.forced and (sub.title == nil or not sub.title:find("SDH")) then
5+
last_sub = sub
6+
end
7+
end
8+
if last_sub then
9+
mp.set_property("sid", tostring(last_sub.id))
10+
end
11+
end
12+
mp.register_event("file-loaded", select_not_forced_subtitle)

0 commit comments

Comments
 (0)