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).
This commit is contained in:
wm4 2014-06-06 17:21:30 +02:00
parent a854583b57
commit 662592c860
1 changed files with 2 additions and 2 deletions

View File

@ -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)