summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-02-13 21:25:09 +0100
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>2015-02-16 18:11:52 +0900
commite3064c3cb79284bba9c45a807cadce745c2e8357 (patch)
treefe1d3d98152400edd588d813a9e8fc98d990089a
parentdf4d15be7b16f5b83e05dcbca7ccc17567839c1e (diff)
downloadmpv-e3064c3cb79284bba9c45a807cadce745c2e8357.tar.bz2
mpv-e3064c3cb79284bba9c45a807cadce745c2e8357.tar.xz
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. (cherry picked from commit 32b56c56bad78d8d3038361aef6f36ad9cabebb0)
-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;