0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 20:03:10 +02:00
mpv/player
Avi Halachmi (:avih) 0197729949 osc.lua: seekbar hover: speed-up chapter access
This speeds up chapter name access while hovering the seekbar:

- Fetch the chapter-list property using observation rather than on
  every render while hovering the bar. Property access, especially
  with potentially lots of values (chapters), can be expensive-ish,
  and can involve locking, so the less per-render the better.

- Sort the list once (on change) to simplify the iteration logic when
  searching the chapter which matches the mouse position. It's still
  O(N) (no binary search currently), but with less work.

The cached sorted list is stored at the state. While there are other
places which access this property and could use this cache, for now we
don't touch them, because they're not performance-critical (on init
for the chapter markers, on ch_{prev,next} button click for OSD).

Caching properties using observation instead of using mp.get_property
can indeed speedup other places too, but it should be part of a system
rather than implemented per-property. Maybe some day.
2022-02-06 11:02:39 +02:00
..
javascript js: utils.get_user_path: make wrapper of expand-path 2022-02-04 12:53:16 +02:00
lua osc.lua: seekbar hover: speed-up chapter access 2022-02-06 11:02:39 +02:00
audio.c audio: fix typo 2021-12-03 14:04:58 -08:00
client.c player: make deprecated track/chapter/metadata events internal 2021-12-15 12:29:10 +01:00
client.h scripting: remove race condition when toggling internal scripts 2020-03-26 23:59:44 +01:00
command.c Revert "options: add --sub-visibility=<primary-only|secondary-only>" 2022-01-19 21:56:28 +02:00
command.h player: make deprecated track/chapter/metadata events internal 2021-12-15 12:29:10 +01:00
configfiles.c options: add watch-later-options 2021-07-21 13:19:28 +00:00
core.h player: add track-list/N/image sub-property 2021-10-14 15:39:07 +00:00
external_files.c player: add thd (TrueHD) to whitelist of audio extensions 2022-01-19 14:00:05 +00:00
external_files.h player: add automatic loading of external cover art files 2020-09-28 00:12:52 +02:00
javascript.c js: utils.get_user_path: make wrapper of expand-path 2022-02-04 12:53:16 +02:00
loadfile.c player: make deprecated track/chapter/metadata events internal 2021-12-15 12:29:10 +01:00
lua.c lua: remove mp.suspend, resume and resume_all 2021-12-15 12:29:10 +01:00
main.c options: add watch-later-options 2021-07-21 13:19:28 +00:00
misc.c audio: refactor how data is passed to AO 2020-08-29 13:12:32 +02:00
osd.c player: add --term-title option 2020-05-25 20:39:37 +02:00
playloop.c player: fix parentheses warning with && 2022-01-18 13:49:19 +00:00
screenshot.c screenshot: add --screenshot-sw option 2020-10-05 00:16:46 +02:00
screenshot.h player: make screenshot each-frame mode more accurate 2020-02-07 13:32:21 +01:00
scripting.c player/scripting: fix use-after-free when loading script folders 2021-04-08 23:47:35 +03:00
sub.c sub: align ytdl-hook secondary subs to the top 2021-08-11 18:15:35 +00:00
video.c {player,video}: remove references to obsolete opengl-cb API 2021-12-15 12:29:10 +01:00