[vlc-commits] video_output:control: de-factorize vout_control_Push code
Steve Lhomme
git at videolan.org
Tue Jan 19 08:56:41 UTC 2021
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Dec 17 10:08:53 2020 +0100| [c315c5cdf8cfeddc4c66c93a1486f80453b0bafc] | committer: Steve Lhomme
video_output:control: de-factorize vout_control_Push code
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c315c5cdf8cfeddc4c66c93a1486f80453b0bafc
---
src/video_output/control.c | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/src/video_output/control.c b/src/video_output/control.c
index b22d0a03f6..38026bf31a 100644
--- a/src/video_output/control.c
+++ b/src/video_output/control.c
@@ -48,21 +48,16 @@ void vout_control_Clean(vout_control_t *ctrl)
ARRAY_RESET(ctrl->cmd);
}
-static void vout_control_Push(vout_control_t *ctrl, vout_control_cmd_t *cmd)
-{
- vlc_mutex_lock(&ctrl->lock);
- ARRAY_APPEND(ctrl->cmd, *cmd);
- vlc_cond_signal(&ctrl->wait_request);
- vlc_mutex_unlock(&ctrl->lock);
-}
-
void vout_control_PushMouse(vout_control_t *ctrl, const vlc_mouse_t *video_mouse)
{
vout_control_cmd_t cmd = {
VOUT_CONTROL_MOUSE_STATE, *video_mouse,
};
- vout_control_Push(ctrl, &cmd);
+ vlc_mutex_lock(&ctrl->lock);
+ ARRAY_APPEND(ctrl->cmd, cmd);
+ vlc_cond_signal(&ctrl->wait_request);
+ vlc_mutex_unlock(&ctrl->lock);
}
void vout_control_Wake(vout_control_t *ctrl)
@@ -79,7 +74,10 @@ void vout_control_PushTerminate(vout_control_t *ctrl)
VOUT_CONTROL_TERMINATE, {0},
};
- vout_control_Push(ctrl, &cmd);
+ vlc_mutex_lock(&ctrl->lock);
+ ARRAY_APPEND(ctrl->cmd, cmd);
+ vlc_cond_signal(&ctrl->wait_request);
+ vlc_mutex_unlock(&ctrl->lock);
}
void vout_control_Hold(vout_control_t *ctrl)
More information about the vlc-commits
mailing list