1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-26 09:02:38 +00:00

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).
This commit is contained in:
Uoti Urpala 2010-04-25 22:05:59 +03:00
parent 4cb23ad350
commit 0b6e3647a5

View File

@ -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)