Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using too many individual scripts with mp.add_key_binding breaks keybinds. #13707

Closed
Sneakpeakcss opened this issue Mar 15, 2024 · 3 comments · Fixed by #13738
Closed

Using too many individual scripts with mp.add_key_binding breaks keybinds. #13707

Sneakpeakcss opened this issue Mar 15, 2024 · 3 comments · Fixed by #13738
Labels

Comments

@Sneakpeakcss
Copy link

Important Information

  • mpv version: mpv-x86_64-v3-20240314-git-5dd2d19
  • Windows Version: WIN10 22H2
  • Source of the mpv binary: zhongfly
  • If known which version of mpv introduced the problem: goes as far as 2022 builds
  • GPU model, driver and version: RX570 Adrenalin 24.1.1

 

Seemingly having too many individual scripts that use mp.add_key_binding breaks key bindings of other scripts, including default ones like console.lua.

Here's an example with uosc and console.lua:

brokenscriptsLUA.mp4

Opening console with ` works, but after that it's completely unresponsive, uosc is also broken from the start.

Weirdly enough, doing the same using JavaScript scripts 'works' a bit differently:

brokenscriptsJS.mp4

In this case console works without issues, but other scripts are still breaking.

Reproduction steps

  1. Download samplescripts and install all 30 lua scripts.

Expected behavior

Using a lot of individual scripts shouldn't remove(?)/overwrite(?) keybinds of other scripts.

Actual behavior

At some treshold (25-30~) scripts start to break. Included 30 sample scripts break it instantly at launch, but in my normal mpv usage i've had situations where everything works properly at the beginning and with time it starts breaking 'randomly' at runtime, to the point where it was a pain to figure out what suddenly caused this issue.

Log file

brokenscriptsLUA.txt
brokenscriptsJS.txt

Sample files

samplescripts.zip

@hooke007
Copy link
Contributor

I must have seen it before. Built-in osc can be reproduced too.

@Sneakpeakcss
Copy link
Author

I must have seen it before. Built-in osc can be reproduced too.

Yea, i've used uosc as an example since it's the easiest to notice on video, in comparison to all other scripts breaking.
I didn't check previously how this behaves with build-in osc, but on my side it seems that it goes beyond keybinds, at best it only flashes for a split of a second on video start and then disappears permanently, so that's even worse.

The only workaround i managed to find is to obviously join all my little scripts into a single file, but that's far from perfect.

@dyphire
Copy link
Contributor

dyphire commented Mar 20, 2024

I can reproduce it. A long time ago, I noticed this issue and could only choose to reduce the number of scripts to avoid it.

na-na-hi added a commit to na-na-hi/mpv that referenced this issue Mar 21, 2024
585d8c6 increased max active
section limit from 5 to 50 but this obviously doesn't properly fix
the problem. Input still breaks if more than 25 scripts are loaded,
or if some scripts define lots of input sections.

Remove the limit completely by using a dynamic array for active sections.

Fixes: mpv-player#13707
na-na-hi added a commit to na-na-hi/mpv that referenced this issue Mar 21, 2024
585d8c6 increased max active
section limit from 5 to 50 but this obviously doesn't properly fix
the problem. Input still breaks if more than 25 scripts are loaded,
or if some scripts define lots of input sections.

Remove the limit completely by using a dynamic array for active sections.

Fixes: mpv-player#13707
kasper93 pushed a commit that referenced this issue Mar 21, 2024
585d8c6 increased max active
section limit from 5 to 50 but this obviously doesn't properly fix
the problem. Input still breaks if more than 25 scripts are loaded,
or if some scripts define lots of input sections.

Remove the limit completely by using a dynamic array for active sections.

Fixes: #13707
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants