Giving very long lines to libass freezes mpv and makes the CPU spin (though it's fine with terminal output). This is often the case user-data/mpv/ytdl/json-subprocess-result in the property list. So limit the length of selectable items to 300 characters (not Unicode aware). This is enough to fill a 1920x1080 window with font_size=16 and Japanese text.
Unified · Split
| @@ -1814,7 +1814,7 @@ mp.register_script_message('get-input', function (script_name, args) · 1813 unmodified lines | ||
| 1814 | 1814 | if args.items then |
| 1815 | 1815 | selectable_items = {} |
| 1816 | 1816 | for i, item in ipairs(args.items) do |
| 1817 | − selectable_items[i] = item:gsub("[\r\n].*", "⋯") | |
| 1817 | + selectable_items[i] = item:gsub("[\r\n].*", "⋯"):sub(1, 300) | |
| 1818 | 1818 | end |
| 1819 | 1819 | |
| 1820 | 1820 | matches = {} |