[vlc-devel] [PATCH v5 4/9] video_output:control: de-factorize vout_control_Push code

Steve Lhomme robux4 at ycbcr.xyz
Fri Dec 18 10:21:27 UTC 2020


---
 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 b22d0a03f66..38026bf31a9 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)
-- 
2.29.2



More information about the vlc-devel mailing list