[vlc-commits] input: send the opening before possible fail

Thomas Guillem git at videolan.org
Thu Nov 15 17:29:01 CET 2018


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Nov 13 16:32:02 2018 +0100| [b59f1aadad3497e5b7f1c9d6803a6b8deeac961b] | committer: Thomas Guillem

input: send the opening before possible fail

Otherwise, listeners can receive error or dead events without receiving any
opening events.

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

 src/input/input.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/input/input.c b/src/input/input.c
index 3f173a9b36..ab184b7593 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -1335,6 +1335,10 @@ static int Init( input_thread_t * p_input )
     input_thread_private_t *priv = input_priv(p_input);
     input_source_t *master;
 
+    /* */
+    input_ChangeState( p_input, OPENING_S );
+    input_SendEventCache( p_input, 0.0 );
+
     if( var_Type( p_input->obj.parent, "meta-file" ) )
     {
         msg_Dbg( p_input, "Input is a meta file: disabling unneeded options" );
@@ -1358,10 +1362,6 @@ static int Init( input_thread_t * p_input )
         goto error;
 
     /* */
-    input_ChangeState( p_input, OPENING_S );
-    input_SendEventCache( p_input, 0.0 );
-
-    /* */
     master = InputSourceNew( p_input, priv->p_item->psz_uri, NULL, false );
     if( master == NULL )
         goto error;



More information about the vlc-commits mailing list