mirror of
https://github.com/mpv-player/mpv.git
synced 2026-10-28 23:13:18 +08:00
ytdl_hook: sort chapters by time
mpv doesn't work well with unordered chapters. ex: https://youtu.be/DIKPUL6b4N8
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user