diff options
author | Ricardo Constantino <wiiaboo@gmail.com> | 2016-11-13 17:02:50 +0000 |
---|---|---|
committer | Ricardo Constantino <wiiaboo@gmail.com> | 2016-11-15 22:58:43 +0000 |
commit | 03ea61c89563a5bb6b9072fcd89f1e577cf0fcbf (patch) | |
tree | d62a4de827dc8ca6a46051dd27051c48f2a509a4 /player/lua/ytdl_hook.lua | |
parent | 274c6f36f551855ec22b9fa73d4214a4f36236fc (diff) | |
download | mpv-03ea61c89563a5bb6b9072fcd89f1e577cf0fcbf.tar.bz2 mpv-03ea61c89563a5bb6b9072fcd89f1e577cf0fcbf.tar.xz |
ytdl_hook: sort chapters by time
mpv doesn't work well with unordered chapters.
ex: https://youtu.be/DIKPUL6b4N8
Diffstat (limited to 'player/lua/ytdl_hook.lua')
-rw-r--r-- | player/lua/ytdl_hook.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/player/lua/ytdl_hook.lua b/player/lua/ytdl_hook.lua index fa97dddc7b..1bae4f398c 100644 --- a/player/lua/ytdl_hook.lua +++ b/player/lua/ytdl_hook.lua @@ -84,7 +84,7 @@ local function extract_chapters(data, video_length) table.insert(ret, {time = time, title = line}) end end - + table.sort(ret, function(a, b) return a.time < b.time end) return ret end |