summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-06-06 17:21:30 +0200
committerwm4 <wm4@nowhere>2014-06-06 17:21:30 +0200
commit662592c8605db0de92c1ff07402637d9a734e201 (patch)
tree71a17225c352089915fd827811b9bbdbc679125c /player
parenta854583b57b62f1b5106966f395375e192686a68 (diff)
downloadmpv-662592c8605db0de92c1ff07402637d9a734e201.tar.bz2
mpv-662592c8605db0de92c1ff07402637d9a734e201.tar.xz
client API: fix swapped pipe ends used with mpv_set_wakeup_callback
This was extremely wrong. It was never tested because nobody ever used it (the feature was added for someone who never tried it in the end).
Diffstat (limited to 'player')
-rw-r--r--player/client.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/player/client.c b/player/client.c
index ba3705a9af..e9a583f17b 100644
--- a/player/client.c
+++ b/player/client.c
@@ -218,7 +218,7 @@ static void wakeup_client(struct mpv_handle *ctx)
if (ctx->wakeup_cb)
ctx->wakeup_cb(ctx->wakeup_cb_ctx);
if (ctx->wakeup_pipe[0] != -1)
- write(ctx->wakeup_pipe[0], &(char){0}, 1);
+ write(ctx->wakeup_pipe[1], &(char){0}, 1);
}
void mpv_set_wakeup_callback(mpv_handle *ctx, void (*cb)(void *d), void *d)
@@ -1284,7 +1284,7 @@ int mpv_get_wakeup_pipe(mpv_handle *ctx)
fail:
#endif
pthread_mutex_unlock(&ctx->lock);
- return ctx->wakeup_pipe[1];
+ return ctx->wakeup_pipe[0];
}
unsigned long mpv_client_api_version(void)