aboutsummaryrefslogtreecommitdiffhomepage
path: root/input
diff options
context:
space:
mode:
authorGravatar wm4 <wm4@nowhere>2015-02-13 21:25:09 +0100
committerGravatar wm4 <wm4@nowhere>2015-02-13 21:25:09 +0100
commit32b56c56bad78d8d3038361aef6f36ad9cabebb0 (patch)
tree89cecc0d7f204236cb8c01aa07d41792010fb407 /input
parentf9f2e1cc4e80a66793249651b74d83c1c8f3a8d4 (diff)
ipc: put playback core to sleep while dequeuing commands
Happens to fix #1581 due to an unfortunate interaction with the way the VO does not react to commands for a while if a video frame is queued. Slightly improves other situations as well, if the client spams mpv with commands during playback.
Diffstat (limited to 'input')
-rw-r--r--input/ipc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/input/ipc.c b/input/ipc.c
index 2ad850e5ed..2e17fd4fac 100644
--- a/input/ipc.c
+++ b/input/ipc.c
@@ -531,9 +531,15 @@ static void *client_thread(void *p)
};
fcntl(arg->client_fd, F_SETFL, fcntl(arg->client_fd, F_GETFL, 0) | O_NONBLOCK);
+ mpv_suspend(arg->client);
while (1) {
- rc = poll(fds, 2, -1);
+ rc = poll(fds, 2, 0);
+ if (rc == 0) {
+ mpv_resume(arg->client);
+ rc = poll(fds, 2, -1);
+ mpv_suspend(arg->client);
+ }
if (rc < 0) {
MP_ERR(arg, "Poll error\n");
continue;