summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-04-25 22:05:59 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-04-25 22:48:40 +0300
commit0b6e3647a504ffd385c424d37575a971eabcb801 (patch)
tree84b94f564e64061d4485d24fe5f8dcb1f056e263 /mplayer.c
parent4cb23ad350f566460d96bf24fcc1949d57a0701f (diff)
downloadmpv-0b6e3647a504ffd385c424d37575a971eabcb801.tar.bz2
mpv-0b6e3647a504ffd385c424d37575a971eabcb801.tar.xz
commands: finish seeks before processing other commands
The code processing seek commands only sets/alters variables specifying the current seek target. Before all queued commands were processed first, and any needed seeks were executed after that. This was somewhat unreliable, as commands queued later were not guaranteed to see all the effects of earlier seek commands if they happened to be processed in the same batch. Change the behavior so that processing commands is interrupted and the real seek executed if the next command is anything other than a basic seek. This guarantees that other commands see a consistent state, while still allowing the combining of consecutive seeks (which is useful for example when the user keeps the seek-forward key pressed down, and key repeat is faster than seeks can be executed).
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/mplayer.c b/mplayer.c
index 4f309ff6fb..dee01bc0b2 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -4309,6 +4309,13 @@ if(auto_quality>0){
mp_cmd_free(cmd);
if (mpctx->stop_play)
break;
+ if (mpctx->rel_seek_secs || mpctx->abs_seek_pos) {
+ cmd = mp_input_get_cmd(mpctx->input, 0, 1);
+ /* Allow seek commands to be combined, but execute the real seek
+ * before processing other commands */
+ if (!cmd || cmd->id != MP_CMD_SEEK)
+ break;
+ }
}
if (!mpctx->paused || mpctx->stop_play || mpctx->rel_seek_secs
|| mpctx->abs_seek_pos)