summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-04-20 21:24:20 +0200
committerJan Ekström <jeebjp@gmail.com>2018-04-29 02:21:32 +0300
commit205b2da160d4941ebf2b55b1f72b9bca60d24aab (patch)
treed04eb2c26fceb73eb1bc70193dd0f7deb92d04f1
parent1c550326ce5a885ef58fee9e1d11c9faab4a13b9 (diff)
downloadmpv-205b2da160d4941ebf2b55b1f72b9bca60d24aab.tar.bz2
mpv-205b2da160d4941ebf2b55b1f72b9bca60d24aab.tar.xz
vo_libmpv: move some update() callbacks out of context lock
update() used to require the lock, but now it doesn't matter. It's slightly better to do it outside of the lock now, in case the update callback reschedules before returning, and the user render thread tries to acquire the still held lock (which would require 2 more context switches).
-rw-r--r--video/out/vo_libmpv.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/video/out/vo_libmpv.c b/video/out/vo_libmpv.c
index 778de778f5..1501a3d244 100644
--- a/video/out/vo_libmpv.c
+++ b/video/out/vo_libmpv.c
@@ -525,8 +525,8 @@ static int control(struct vo *vo, uint32_t request, void *data)
pthread_mutex_lock(&p->ctx->lock);
forget_frames(p->ctx, false);
p->ctx->need_reset = true;
- update(p->ctx);
pthread_mutex_unlock(&p->ctx->lock);
+ update(p->ctx);
return VO_TRUE;
case VOCTRL_PAUSE:
vo->want_redraw = true;
@@ -537,14 +537,14 @@ static int control(struct vo *vo, uint32_t request, void *data)
case VOCTRL_SET_PANSCAN:
pthread_mutex_lock(&p->ctx->lock);
p->ctx->need_resize = true;
- update(p->ctx);
pthread_mutex_unlock(&p->ctx->lock);
+ update(p->ctx);
return VO_TRUE;
case VOCTRL_UPDATE_RENDER_OPTS:
pthread_mutex_lock(&p->ctx->lock);
p->ctx->need_update_external = true;
- update(p->ctx);
pthread_mutex_unlock(&p->ctx->lock);
+ update(p->ctx);
return VO_TRUE;
}