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

stats.lua: prevent freeze in certain cases with vidscale=no #14153

Merged
merged 1 commit into from
May 20, 2024

Conversation

guidocella
Copy link
Contributor

If using --script-opts=stats-vidscale=no, until osd-height changes from 0 to the correct value, stats.lua's text sizes are multiplied by a scale of 720, which with the default font size results in a font size of 5760. Depending on the order of operations, if the stats are drawn at this size before osd-height is updated, mpv freezes. I get this with --input-commands=script-message-to stats display-stats-toggle in conditional profiles, e.g.:

mpv --script-opts=stats-vidscale=no --include=<(echo $'[test]\nprofile-cond=true\ninput-commands=script-message-to stats display-stats-toggle') av://lavfi:testsrc

Fix this by setting a scale to 1 until osd-height is updated to the correct value.

player/lua/stats.lua Outdated Show resolved Hide resolved
If using --script-opts=stats-vidscale=no, until osd-height changes from
0 to the correct value, stats.lua's text sizes are multiplied by a scale
of 720, which with the default font size results in a font size of 5760.
Depending on the order of operations, if the stats are drawn at this
size before osd-height is updated, mpv freezes. I get this with
--input-commands=script-message-to stats display-stats-toggle in
conditional profiles, e.g.:

mpv --script-opts=stats-vidscale=no --include=<(echo $'[test]\nprofile-cond=true\ninput-commands=script-message-to stats display-stats-toggle') av://lavfi:testsrc

Fix this by setting a scale to 1 until osd-height is updated to the
correct value.
Copy link

github-actions bot commented May 15, 2024

Download the artifacts for this pull request:

Windows
macOS

@kasper93 kasper93 merged commit daba15b into mpv-player:master May 20, 2024
18 checks passed
@guidocella guidocella deleted the limit-stats-scale branch May 20, 2024 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants