diff options
author | wm4 <wm4@nowhere> | 2013-09-10 16:50:19 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-09-10 16:50:19 +0200 |
commit | 6a850b02647c062f3ae48aaa180bf7ea1fe30576 (patch) | |
tree | ca2826222537f965eeaca75f7b9aea4fa16ac87e /mpvcore | |
parent | cf0e852fcdd4f6e223d76f21ce27f89681bd6e74 (diff) | |
download | mpv-6a850b02647c062f3ae48aaa180bf7ea1fe30576.tar.bz2 mpv-6a850b02647c062f3ae48aaa180bf7ea1fe30576.tar.xz |
quvi: restore playback position when switching formats
This simply issues a seek after reloading.
Diffstat (limited to 'mpvcore')
-rw-r--r-- | mpvcore/command.c | 7 | ||||
-rw-r--r-- | mpvcore/mplayer.c | 3 |
2 files changed, 9 insertions, 1 deletions
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); |