[vlc-commits] vout: fix race on updating inhibition

Rémi Denis-Courmont git at videolan.org
Sun Jan 27 22:10:05 CET 2019


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jan 27 19:18:42 2019 +0200| [0f2dc84f8fc65ad0efcd0d835410117809c97c39] | committer: Rémi Denis-Courmont

vout: fix race on updating inhibition

The vout window is not reentrant, needs its lock.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0f2dc84f8fc65ad0efcd0d835410117809c97c39
---

 src/video_output/video_output.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 408cbd3199..ddb983d052 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1498,9 +1498,11 @@ void vout_ChangePause(vout_thread_t *vout, bool is_paused, vlc_tick_t date)
     }
     vout->p->pause.is_on = is_paused;
     vout->p->pause.date  = date;
+    vout_control_Release(&vout->p->control);
 
+    vlc_mutex_lock(&vout->p->window_lock);
     vout_window_SetInhibition(vout->p->display_cfg.window, !is_paused);
-    vout_control_Release(&vout->p->control);
+    vlc_mutex_unlock(&vout->p->window_lock);
 }
 
 static void ThreadFlush(vout_thread_t *vout, bool below, vlc_tick_t date)



More information about the vlc-commits mailing list