summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-07-28 22:13:42 +0200
committerwm4 <wm4@nowhere>2014-07-28 22:13:42 +0200
commit846257da13494f910f44c9ea8a56a3c2ef669a0f (patch)
treee6aaef6135c1b7fe8d9099048bde67242a889130
parent26bfcc9c82a3cfe330f8d638f69cb72a76652f14 (diff)
downloadmpv-846257da13494f910f44c9ea8a56a3c2ef669a0f.tar.bz2
mpv-846257da13494f910f44c9ea8a56a3c2ef669a0f.tar.xz
player: logically speed up seek logic
Commit 261506e3 made constant seeking feel slower, because a subtle change in the restart logic makes it now waste time showing another video frame. The slowdown is about 20%. (Background: the seek logic explicitly waits until a video frame is displayed, because this makes it easier for the user to search for something in the video. Without this logic, the display would freeze until the user stops giving seek commands.) Fix this by letting the seek logic issue another seek as soon as the first video frame is displayed. This will prevent it from showing a (useless, slow) second frame. Now it seems to be as fast as before the change. One side-effect is that the next seek happens after the first video frame, but _before_ audio is restarted. Seeking is now silent. I guess this is ok, so we don't do anything about it. Actually, I think whether this happens is probably random; the seeking logic simply doesn't make this explicit, so anything can happen.
-rw-r--r--player/playloop.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/player/playloop.c b/player/playloop.c
index 57cb0e0284..f17f44311e 100644
--- a/player/playloop.c
+++ b/player/playloop.c
@@ -371,7 +371,7 @@ void execute_queued_seek(struct MPContext *mpctx)
/* If the user seeks continuously (keeps arrow key down)
* try to finish showing a frame from one location before doing
* another seek (which could lead to unchanging display). */
- if (!mpctx->seek.immediate && !mpctx->restart_complete &&
+ if (!mpctx->seek.immediate && mpctx->video_status < STATUS_READY &&
mp_time_sec() - mpctx->start_timestamp < 0.3)
return;
mp_seek(mpctx, mpctx->seek, false);