diff options
Diffstat (limited to 'demux/demux_cue.c')
-rw-r--r-- | demux/demux_cue.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/demux/demux_cue.c b/demux/demux_cue.c index b7b425af03..2549aed101 100644 --- a/demux/demux_cue.c +++ b/demux/demux_cue.c @@ -20,7 +20,6 @@ #include <stdlib.h> #include <stdbool.h> #include <string.h> -#include <dirent.h> #include <inttypes.h> #include "osdep/io.h" @@ -42,25 +41,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 +266,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 +280,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) { |