mpv
mpv copied to clipboard
Subtitle autoselect improvements
Addresses #8863
- (Some platform-specific infrastructural tweaks to provide needed routines)
- Support for matching 2-character language tags against 3-character ones, and vice versa
- Minimal IETF language tag matching support, with support for 2-subtag tags (language+region)
- Full subtitles off by default when audio language matches preferred subtitle language
slangdefaults to the user's OS-level preferred language list- Additional controls for subtitle autoselection behavior
- Fix various issues with forced-only autoselection
- Expose forced-only autoselection in CLI
- Expose forced-only autoselection and provide toggle in OSC
Swift: avoid unnecessary unsafe conversions; fixes crash in debug builds is an unrelated commit and should not be included in this PR. i will comment on the actual change there.
Yeah, I just can't debug without it.
Updated with some changes:
- User language detection now works correctly on Windows (and has been tested there)
- Forced-only autodetection behavior is now better-exposed in properties
- Forced-only sub mode is now exposed, and toggleable, in the OSC (though the indicator is currently very simple and text-based)
(Re-pushes fix meson build)
Rebased on latest master.
I'm still using version 0.32.0 MPV from January 2020 due to https://github.com/mpv-player/mpv/issues/8396, since this has yet to be merged.
Thank you ❤
Pushed with comments addressed.
So I tested this and here are my thoughts:
- the automatic selection changes work well in general
slangandsubs-with-matching-audiodefault change needs to be documented in interface changes- maybe there could be some smart rules to hide the [F], when watching non-dubbed content it just acts as a funny alternative to pressing
v - when no sub tracks are present the
[ ]never appears, if no track is selected it appears but is disabled. intentional? - I couldn't get the signs track to be properly selected with
slang=autoon this file, but I think that's a file issue -> https://0x0.st/HqXu.mkv
Just as a note, I'm kinda hoping someone can eventually come up with an icon pair to replace the [F].
Re: docs, sure, I'll write 'em up.
Re: automatically hiding [F] when not relevant, I could probably decide based on sub format for now (forced events only really apply to vobsub and PGS right now); maybe long-term this should be exposed by lavc as a flag in AVCodecDescriptor.
Re: inconsistent display of [ ], I'll take a look; I don't recall the details there.
Re: that file, yeah, it's improperly tagged (nothing's marked as forced).
Re: [ ] display, what behavior would you prefer? I could hide it altogether whenever the currently-selected track isn't either dvdsub or PGS?
Rebased and re-pushed; I believe all comments are addressed. Forced-only is no longer used for codecs that cannot include forced events, and the [ ] box is hidden when such a codec is not in use.
one more: I'd rename
Add more precise sub fallback options
to
player: add more precise sub fallback options
needs rebase
Rebased and addressed commit-message issue; are we good to merge?