[vlc-commits] input: Add a synchronous control helper

Hugo Beauzée-Luyssen git at videolan.org
Tue Sep 24 14:34:22 CEST 2019


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Wed Aug  7 14:47:19 2019 +0200| [9ff7854e2a73d37faf4ae95f81ba082d25810643] | committer: Hugo Beauzée-Luyssen

input: Add a synchronous control helper

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9ff7854e2a73d37faf4ae95f81ba082d25810643
---

 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 655c7bb139..97d299a7bd 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -1796,6 +1796,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);
 }
 
+void input_ControlSync(input_thread_t *p_input, int i_type,
+                       const input_control_param_t* param )
+{
+    assert( !input_priv(p_input)->is_running );
+    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 723a0dbf50..3dc2aed90e 100644
--- a/src/input/input_internal.h
+++ b/src/input/input_internal.h
@@ -624,6 +624,11 @@ static inline int input_ControlPushEsHelper( input_thread_t *p_input, int i_type
     } );
 }
 
+/** Synchronously execute a control sequence. This MUST only be used before the
+ * input is started
+ */
+void input_ControlSync(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);



More information about the vlc-commits mailing list