mpv-player / mpv

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

m_option: add a way for aliases to use sub option prefix #14421

Closed Dudemanguy closed 4 days ago

Dudemanguy commented 6 days ago

Previously, using m_option_type_alias required that the alias have the full name of the option value. This is limited if you are reusing the same opts struct in different sub options. Fix this by add an additional field to m_option to signal whether or not prefixes should be taken into account for the alias option. Instead of blindly using whatever is stored in opt->priv as the name, we can construct the desired option name for either case (using the prefix or not).

Would be useful for #14195.

github-actions[bot] commented 6 days ago

Download the artifacts for this pull request:

Windows * [mpv-i686-w64-mingw32](https://nightly.link/mpv-player/mpv/actions/artifacts/1629804369.zip) * [mpv-x86_64-w64-mingw32](https://nightly.link/mpv-player/mpv/actions/artifacts/1629807403.zip) * [mpv-x86_64-windows-msvc](https://nightly.link/mpv-player/mpv/actions/artifacts/1629811973.zip)
macOS * [mpv-macos-12-intel](https://nightly.link/mpv-player/mpv/actions/artifacts/1629802146.zip) * [mpv-macos-13-intel](https://nightly.link/mpv-player/mpv/actions/artifacts/1629803651.zip) * [mpv-macos-14-arm](https://nightly.link/mpv-player/mpv/actions/artifacts/1629803090.zip)