summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-09-10 16:50:19 +0200
committerwm4 <wm4@nowhere>2013-09-10 16:50:19 +0200
commit6a850b02647c062f3ae48aaa180bf7ea1fe30576 (patch)
treeca2826222537f965eeaca75f7b9aea4fa16ac87e
parentcf0e852fcdd4f6e223d76f21ce27f89681bd6e74 (diff)
downloadmpv-6a850b02647c062f3ae48aaa180bf7ea1fe30576.tar.bz2
mpv-6a850b02647c062f3ae48aaa180bf7ea1fe30576.tar.xz
quvi: restore playback position when switching formats
This simply issues a seek after reloading.
-rw-r--r--DOCS/man/en/options.rst7
-rw-r--r--mpvcore/command.c7
-rw-r--r--mpvcore/mplayer.c3
3 files changed, 13 insertions, 4 deletions
diff --git a/DOCS/man/en/options.rst b/DOCS/man/en/options.rst
index 28046c6bd8..f34268bd6d 100644
--- a/DOCS/man/en/options.rst
+++ b/DOCS/man/en/options.rst
@@ -1660,9 +1660,10 @@
The following explanations are relevant:
`<http://quvi.sourceforge.net/doc/0.9/glossary_termino.html#m_stream_id>`_
- With 0.9.x, the ``quvi-format`` property can be used at runtime to cycle
- through the list of formats. Unfortunately, this resets the playback
- position and is slow too.
+ 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.
``--radio=<option1:option2:...>``
These options set various parameters of the radio capture module. For
diff --git a/mpvcore/command.c b/mpvcore/command.c
index a99dd3dcab..f5421d48fe 100644
--- a/mpvcore/command.c
+++ b/mpvcore/command.c
@@ -534,6 +534,13 @@ static int mp_property_quvi_format(m_option_t *prop, int action, void *arg,
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: {
diff --git a/mpvcore/mplayer.c b/mpvcore/mplayer.c
index b295cb5cec..3590168d22 100644
--- a/mpvcore/mplayer.c
+++ b/mpvcore/mplayer.c
@@ -4549,7 +4549,8 @@ terminate_playback: // don't jump here after ao/vo/getch initialization!
uninit_player(mpctx, uninitialize_parts);
// xxx handle this as INITIALIZED_CONFIG?
- m_config_restore_backups(mpctx->mconfig);
+ if (mpctx->stop_play != PT_RESTART)
+ m_config_restore_backups(mpctx->mconfig);
mpctx->filename = NULL;
talloc_free(mpctx->resolve_result);