mirror of
https://github.com/mpv-player/mpv
synced 2024-12-23 15:22:09 +00:00
demux: change the default of metadata-codepage to auto
There's really no reason not to do this especially since sub-codepage already defaults to auto. Also change logging in charset_conv since telling us that the data is UTF-8 if the passed codepage value is "auto" or "utf-8" is really not useful information (that's the expectation).
This commit is contained in:
parent
50b23a8c44
commit
da4f11803f
@ -97,6 +97,7 @@ Interface changes
|
||||
- add `--window-affinity` option
|
||||
- `--config-dir` no longer forces cache and state files to also reside in there
|
||||
- deprecate `--demuxer-cue-codepage` in favor of `--metadata-codepage`
|
||||
- change the default of `metadata-codepage` to `auto`
|
||||
--- mpv 0.36.0 ---
|
||||
- add `--target-contrast`
|
||||
- Target luminance value is now also applied when ICC profile is used.
|
||||
|
@ -7315,10 +7315,9 @@ Miscellaneous
|
||||
filters.
|
||||
|
||||
``--metadata-codepage=<codepage>``
|
||||
Codepage for various input metadata (default: ``utf-8``). This affects how
|
||||
file tags, chapter titles, etc. are interpreted. You can for example set
|
||||
this to ``auto`` to enable autodetection of the codepage. (This is not the
|
||||
default because non-UTF-8 codepages are an obscure fringe use-case.)
|
||||
Codepage for various input metadata (default: ``auto``). This affects how
|
||||
file tags, chapter titles, etc. are interpreted. In most cases, this merely
|
||||
evaluates to UTF-8 as non-UTF-8 codepages are obscure.
|
||||
|
||||
See ``--sub-codepage`` option on how codepages are specified and further
|
||||
details regarding autodetection and codepage conversion. (The underlying
|
||||
|
@ -142,7 +142,7 @@ const struct m_sub_options demux_conf = {
|
||||
[STREAM_VIDEO] = 1,
|
||||
[STREAM_AUDIO] = 10,
|
||||
},
|
||||
.meta_cp = "utf-8",
|
||||
.meta_cp = "auto",
|
||||
},
|
||||
.get_sub_options = get_demux_sub_opts,
|
||||
};
|
||||
|
@ -114,7 +114,8 @@ const char *mp_charset_guess(void *talloc_ctx, struct mp_log *log, bstr buf,
|
||||
|
||||
int r = bstr_validate_utf8(buf);
|
||||
if (r >= 0 || (r > -8 && (flags & MP_ICONV_ALLOW_CUTOFF))) {
|
||||
mp_verbose(log, "Data looks like UTF-8, ignoring user-provided charset.\n");
|
||||
if (strcmp(user_cp, "auto") != 0 && !mp_charset_is_utf8(user_cp))
|
||||
mp_verbose(log, "Data looks like UTF-8, ignoring user-provided charset.\n");
|
||||
return "utf-8";
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user