[vlc-devel] [PATCH 4/7] vout/control: set the return value directly

Steve Lhomme robux4 at ycbcr.xyz
Thu Aug 13 14:12:45 CEST 2020


We don't care if there were commands or not.
---
 src/video_output/control.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/video_output/control.c b/src/video_output/control.c
index 9faacb7e815..675953f2c89 100644
--- a/src/video_output/control.c
+++ b/src/video_output/control.c
@@ -158,17 +158,17 @@ 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);
 
-    bool has_cmd;
+    int ret;
     if (ctrl->cmd.i_size > 0) {
-        has_cmd = true;
+        ret = VLC_SUCCESS;
         *cmd = ARRAY_VAL(ctrl->cmd, 0);
         ARRAY_REMOVE(ctrl->cmd, 0);
     } else {
-        has_cmd = false;
+        ret = VLC_EGENERIC;
         ctrl->can_sleep = true;
     }
     vlc_mutex_unlock(&ctrl->lock);
 
-    return has_cmd ? VLC_SUCCESS : VLC_EGENERIC;
+    return ret;
 }
 
-- 
2.26.2



More information about the vlc-devel mailing list