[vlc-devel] [PATCH 06/14] input: Add a synchronous control helper

Hugo Beauzée-Luyssen hugo at beauzee.fr
Mon Sep 23 11:44:49 CEST 2019


---
 src/input/input.c          | 6 ++++++
 src/input/input_internal.h | 5 +++++
 2 files changed, 11 insertions(+)

diff --git a/src/input/input.c b/src/input/input.c
index abd84936b9..a99a005f91 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -1786,6 +1786,12 @@ static void ControlInsertDemuxFilter( input_thread_t* p_input, const char* psz_d
         msg_Dbg(p_input, "Failed to create demux filter %s", psz_demux_chain);
 }
 
+bool input_Control(input_thread_t *p_input, int i_type,
+                   const input_control_param_t* param )
+{
+    assert( !input_priv(p_input)->is_running );
+    return Control( p_input, i_type, *param );
+}
 
 static bool Control( input_thread_t *p_input,
                      int i_type, input_control_param_t param )
diff --git a/src/input/input_internal.h b/src/input/input_internal.h
index 23250e72c7..29809cf4b6 100644
--- a/src/input/input_internal.h
+++ b/src/input/input_internal.h
@@ -599,6 +599,11 @@ static inline void input_ControlPushEsHelper( input_thread_t *p_input, int i_typ
     } );
 }
 
+/** Synchronously execute a control sequence. This MUST only be used before the
+ * input is started
+ */
+bool input_Control(input_thread_t *, int, const input_control_param_t *);
+
 bool input_Stopped( input_thread_t * );
 
 int input_GetAttachments(input_thread_t *input, input_attachment_t ***attachments);
-- 
2.20.1



More information about the vlc-devel mailing list