summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-10-01 12:31:06 -0500
committerDudemanguy <random342@airmail.cc>2023-10-07 02:41:27 +0000
commit50b23a8c4493517fa2130250d22d94bca4e27804 (patch)
tree416964c4f9fab7732fc3cc55e93e665f6a31400c
parenta96dd2f5e76c69859caa7b6e34b2fd9fd9e89672 (diff)
downloadmpv-50b23a8c4493517fa2130250d22d94bca4e27804.tar.bz2
mpv-50b23a8c4493517fa2130250d22d94bca4e27804.tar.xz
demux_cue: deprecate --demuxer-cue-codepage for --metadata-codepage
What are cue sheets not metadata or something? No reason this needs to be a separate option so just deprecate it. This does mean that the default value changes from "auto" to "utf-8" for this obscure fringe case. I really hope people don't use non-UTF-8 cuesheets, but the next commit will change the default of --metadata-codepage to "auto" so there's no actual change in behavior to users.
-rw-r--r--DOCS/interface-changes.rst1
-rw-r--r--DOCS/man/options.rst3
-rw-r--r--demux/demux_cue.c21
3 files changed, 7 insertions, 18 deletions
diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst
index 9c7d69487a..b9fbb9739c 100644
--- a/DOCS/interface-changes.rst
+++ b/DOCS/interface-changes.rst
@@ -96,6 +96,7 @@ Interface changes
- add `--backdrop-type` option
- 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`
--- mpv 0.36.0 ---
- add `--target-contrast`
- Target luminance value is now also applied when ICC profile is used.
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst
index 8d9ae79c38..eb1fc01542 100644
--- a/DOCS/man/options.rst
+++ b/DOCS/man/options.rst
@@ -3792,9 +3792,6 @@ Demuxer
``--demuxer-rawvideo-size=<value>``
Frame size in bytes when using ``--demuxer=rawvideo``.
-``--demuxer-cue-codepage=<codepage>``
- Specify the CUE sheet codepage. (See ``--sub-codepage`` for details.)
-
``--demuxer-max-bytes=<bytesize>``
This controls how much the demuxer is allowed to buffer ahead. The demuxer
will normally try to read ahead as much as necessary, or as much is
diff --git a/demux/demux_cue.c b/demux/demux_cue.c
index b7b425af03..4937ec967b 100644
--- a/demux/demux_cue.c
+++ b/demux/demux_cue.c
@@ -42,25 +42,15 @@
#define PROBE_SIZE 512
-#define OPT_BASE_STRUCT struct demux_cue_opts
-struct demux_cue_opts {
- char *cue_cp;
-};
-
const struct m_sub_options demux_cue_conf = {
.opts = (const m_option_t[]) {
- {"codepage", OPT_STRING(cue_cp)},
+ {"codepage", OPT_REPLACED("metadata-codepage")},
{0}
},
- .size = sizeof(struct demux_cue_opts),
- .defaults = &(const struct demux_cue_opts) {
- .cue_cp = "auto"
- }
};
struct priv {
struct cue_file *f;
- struct demux_cue_opts *opts;
};
static void add_source(struct timeline *tl, struct demuxer *d)
@@ -277,13 +267,12 @@ static int try_open_file(struct demuxer *demuxer, enum demux_check check)
struct priv *p = talloc_zero(demuxer, struct priv);
demuxer->priv = p;
demuxer->fully_read = true;
- p->opts = mp_get_config_group(p, demuxer->global, &demux_cue_conf);
- struct demux_cue_opts *cue_opts = p->opts;
-
bstr data = stream_read_complete(s, p, 1000000);
if (data.start == NULL)
return -1;
- const char *charset = mp_charset_guess(p, demuxer->log, data, cue_opts->cue_cp, 0);
+
+ struct demux_opts *opts = mp_get_config_group(p, demuxer->global, &demux_conf);
+ const char *charset = mp_charset_guess(p, demuxer->log, data, opts->meta_cp, 0);
if (charset && !mp_charset_is_utf8(charset)) {
MP_INFO(demuxer, "Using CUE charset: %s\n", charset);
bstr utf8 = mp_iconv_to_utf8(demuxer->log, data, charset, MP_ICONV_VERBOSE);
@@ -292,6 +281,8 @@ static int try_open_file(struct demuxer *demuxer, enum demux_check check)
data = utf8;
}
}
+ talloc_free(opts);
+
p->f = mp_parse_cue(data);
talloc_steal(p, p->f);
if (!p->f) {