mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.1k stars 2.88k forks source link

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

Closed guidocella closed 4 months ago

guidocella commented 4 months ago

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.

github-actions[bot] commented 4 months ago

Download the artifacts for this pull request:

Windows * [mpv-i686-w64-mingw32](https://nightly.link/mpv-player/mpv/actions/artifacts/1506431013.zip) * [mpv-x86_64-w64-mingw32](https://nightly.link/mpv-player/mpv/actions/artifacts/1506433712.zip) * [mpv-x86_64-windows-msvc](https://nightly.link/mpv-player/mpv/actions/artifacts/1506456822.zip)
macOS * [mpv-macos-14-arm](https://nightly.link/mpv-player/mpv/actions/artifacts/1506416275.zip) * [mpv-macos-13-intel](https://nightly.link/mpv-player/mpv/actions/artifacts/1506417333.zip) * [mpv-macos-12-intel](https://nightly.link/mpv-player/mpv/actions/artifacts/1506429455.zip)