Advertisement
Guest User

patch OSC

a guest
Dec 5th, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. [code]
  2. diff --git a/player/lua/osc.lua b/player/lua/osc.lua
  3. index a6cdcbe..7b128fa 100644
  4. --- a/player/lua/osc.lua
  5. +++ b/player/lua/osc.lua
  6. @@ -637,7 +637,20 @@ function render_elements(master_ass)
  7. elem_ass:append(string.format("{\\1a&H%X&\\2a&H%X&\\3a&H%X&\\4a&H%X&}",
  8. ar[1], ar[2], ar[3], ar[4]))
  9.  
  10. - elem_ass:append(tooltiplabel)
  11. + local chapters = mp.get_property_native("chapter-list", {})
  12. +
  13. + if (#chapters > 0) then
  14. + local current_chapter = chapters[#chapters].title
  15. + for n = 1, #chapters do
  16. + if (mp.format_time(chapters[n].time) > tooltiplabel) then
  17. + current_chapter = chapters[n-1].title
  18. + break
  19. + end
  20. + end
  21. + elem_ass:append(tooltiplabel .. " - " .. current_chapter)
  22. + else
  23. + elem_ass:append(tooltiplabel)
  24. + end
  25.  
  26. end
  27. end
  28. [/code]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement