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

Thomas Guillem git at videolan.org
Thu Nov 15 16:23:27 CET 2018


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Nov 13 16:32:02 2018 +0100| [4e1840d4706f20269b4dbdf19f01f38f2cbe58be] | 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=4e1840d4706f20269b4dbdf19f01f38f2cbe58be
---

 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 292d811412..a7ae72bed6 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