From 03ea61c89563a5bb6b9072fcd89f1e577cf0fcbf Mon Sep 17 00:00:00 2001 From: Ricardo Constantino Date: Sun, 13 Nov 2016 17:02:50 +0000 Subject: [PATCH] ytdl_hook: sort chapters by time mpv doesn't work well with unordered chapters. ex: https://youtu.be/DIKPUL6b4N8 --- player/lua/ytdl_hook.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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