From 8d92128f6b587095b9983b17c96b68125b038a27 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 1 Sep 2014 23:27:33 +0200 Subject: command: remove broken quvi-format property Never really worked, and libquvi is probably a lost cause anyway. --- DOCS/man/input.rst | 5 ---- DOCS/man/options.rst | 5 ---- etc/input.conf | 2 -- player/command.c | 74 ---------------------------------------------------- 4 files changed, 86 deletions(-) diff --git a/DOCS/man/input.rst b/DOCS/man/input.rst index 180ff71d68..79d77acc2c 100644 --- a/DOCS/man/input.rst +++ b/DOCS/man/input.rst @@ -1261,11 +1261,6 @@ Property list "title" MPV_FORMAT_STRING "time" MPV_FORMAT_DOUBLE -``quvi-format`` (RW) - See ``--quvi-format``. Cycling this property (``cycle``) will attempt to - cycle through known format, although currently this feature doesn't work - well at all. - ``af`` (RW) See ``--af`` and the ``af`` command. diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index 1afaad7e84..da033d8997 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -679,11 +679,6 @@ Video The following explanations are relevant: ``_ - The ``quvi-format`` property can be used at runtime to cycle through the - list of formats. Unfortunately, this is slow. On libquvi 0.4.x, this - functionality is limited to switching between ``best`` and ``default`` if - the ``cycle`` input command is used. - ``--vd-lavc-check-hw-profile=`` Check hardware decoder profile (default: yes). If ``no`` is set, the highest profile of the hardware decoder is unconditionally selected, and diff --git a/etc/input.conf b/etc/input.conf index 69716b0de5..97118e14e5 100644 --- a/etc/input.conf +++ b/etc/input.conf @@ -207,5 +207,3 @@ # ? cycle sub-forced-only # toggle DVD forced subs # ? cycle program # cycle transport stream programs # ? stop # stop playback (quit or enter idle mode) -# ? cycle quvi-format 1 # cycle streaming video quality (semi-broken) -# ? cycle quvi-format -1 diff --git a/player/command.c b/player/command.c index 6c163c172b..02f8ce55bf 100644 --- a/player/command.c +++ b/player/command.c @@ -748,79 +748,6 @@ static int property_list_editions(void *ctx, struct m_property *prop, get_edition_entry, mpctx); } -static struct mp_resolve_src *find_source(struct mp_resolve_result *res, - char *encid, char *url) -{ - if (res->num_srcs == 0) - return NULL; - - int src = 0; - for (int n = 0; n < res->num_srcs; n++) { - char *s_url = res->srcs[n]->url; - char *s_encid = res->srcs[n]->encid; - if (url && s_url && strcmp(url, s_url) == 0) { - src = n; - break; - } - // Prefer source URL if possible; so continue in case encid isn't unique - if (encid && s_encid && strcmp(encid, s_encid) == 0) - src = n; - } - return res->srcs[src]; -} - -static int mp_property_quvi_format(void *ctx, struct m_property *prop, - int action, void *arg) -{ - MPContext *mpctx = ctx; - struct MPOpts *opts = mpctx->opts; - struct mp_resolve_result *res = mpctx->resolve_result; - if (!res || !res->num_srcs) - return M_PROPERTY_UNAVAILABLE; - - struct mp_resolve_src *cur = find_source(res, opts->quvi_format, res->url); - if (!cur) - return M_PROPERTY_UNAVAILABLE; - - switch (action) { - case M_PROPERTY_GET: - *(char **)arg = talloc_strdup(NULL, cur->encid); - return M_PROPERTY_OK; - case M_PROPERTY_SET: { - mpctx->stop_play = PT_RESTART; - // Make it restart at the same position. This will have disastrous - // consequences if the stream is not arbitrarily seekable, but whatever. - m_config_backup_opt(mpctx->mconfig, "start"); - opts->play_start = (struct m_rel_time) { - .type = REL_TIME_ABSOLUTE, - .pos = get_current_time(mpctx), - }; - break; - } - case M_PROPERTY_SWITCH: { - struct m_property_switch_arg *sarg = arg; - int pos = 0; - for (int n = 0; n < res->num_srcs; n++) { - if (res->srcs[n] == cur) { - pos = n; - break; - } - } - pos += sarg->inc; - if (pos < 0 || pos >= res->num_srcs) { - if (sarg->wrap) { - pos = (res->num_srcs + pos) % res->num_srcs; - } else { - pos = av_clip(pos, 0, res->num_srcs); - } - } - char *fmt = res->srcs[pos]->encid; - return mp_property_quvi_format(mpctx, prop, M_PROPERTY_SET, &fmt); - } - } - return mp_property_generic_option(mpctx, prop, action, arg); -} - /// Number of titles in BD/DVD static int mp_property_disc_titles(void *ctx, struct m_property *prop, int action, void *arg) @@ -2782,7 +2709,6 @@ static const struct m_property mp_properties[] = { {"disc-menu-active", mp_property_disc_menu}, {"chapter", mp_property_chapter}, {"edition", mp_property_edition}, - {"quvi-format", mp_property_quvi_format}, {"disc-titles", mp_property_disc_titles}, {"chapters", mp_property_chapters}, {"editions", mp_property_editions}, -- cgit v1.2.3