path: root/player/video.c
diff options
authorwm4 <wm4@nowhere>2018-05-09 22:38:21 +0200
committerwm4 <wm4@nowhere>2018-05-24 19:56:34 +0200
commita4321cf6877f47a381ff40bea73ca2934635ea58 (patch)
tree781a87047b16653f92f234b4f61786f6c369411e /player/video.c
parent059e7fdb3aaace0c6259728547da1896249818e4 (diff)
screenshot: change async behavior to be in line with new semantics
Basically reimplement the async behavior on top of the async command code. With this, all screenshot commands are async, and the "async" prefix basically does nothing. The prefix now behaves exactly like with other commands that use spawn_thread. This also means using the prefix in the preset input.conf is pointless (without effect) and misleading, so remove that. The each_frame mode was actually particularly painful in making this change, since the player wants to block for it when writing a screenshot, and generally doesn't fit into the new infrastructure. It was still relatively easy to reimplement by copying the original command and then repeating it on each frame. The waiting is reentrant now, so move the call in video.c to a "safer" spot. One way to observe how the new semantics interact with everything is using the mpv repl script and sending a screenshot command through it. Without async flag, the script will freeze while writing the screenshot (while playback continues), while with async flag it continues.
Diffstat (limited to 'player/video.c')
1 files changed, 2 insertions, 1 deletions
diff --git a/player/video.c b/player/video.c
index fde92851a1..7478c64806 100644
--- a/player/video.c
+++ b/player/video.c
@@ -1168,7 +1168,6 @@ void write_video(struct MPContext *mpctx)
MP_VERBOSE(mpctx, "first video frame after restart shown\n");
- screenshot_flip(mpctx);
mp_notify(mpctx, MPV_EVENT_TICK, NULL);
@@ -1187,6 +1186,8 @@ void write_video(struct MPContext *mpctx)
+ screenshot_flip(mpctx);