[vlc-commits] vout/control: make vout_control_Pop() cancel-safe
Rémi Denis-Courmont
git at videolan.org
Wed May 8 20:21:36 CEST 2019
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed May 8 19:19:50 2019 +0300| [41cbf6bcfb11683bcb0e3102d54ee1d208f193ca] | committer: Rémi Denis-Courmont
vout/control: make vout_control_Pop() cancel-safe
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=41cbf6bcfb11683bcb0e3102d54ee1d208f193ca
---
src/video_output/control.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/video_output/control.c b/src/video_output/control.c
index dbcc3036ff..84bcc31869 100644
--- a/src/video_output/control.c
+++ b/src/video_output/control.c
@@ -154,6 +154,8 @@ int vout_control_Pop(vout_control_t *ctrl, vout_control_cmd_t *cmd,
vlc_tick_t deadline)
{
vlc_mutex_lock(&ctrl->lock);
+ mutex_cleanup_push(&ctrl->lock);
+
if (ctrl->cmd.i_size <= 0) {
/* Spurious wakeups are perfectly fine */
if (deadline != VLC_TICK_INVALID && ctrl->can_sleep) {
@@ -166,6 +168,7 @@ int vout_control_Pop(vout_control_t *ctrl, vout_control_cmd_t *cmd,
while (ctrl->is_held)
vlc_cond_wait(&ctrl->wait_available, &ctrl->lock);
+ vlc_cleanup_pop();
bool has_cmd;
if (ctrl->cmd.i_size > 0) {
More information about the vlc-commits
mailing list