Commit 3a88025b authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

input: Make sure stat info are created before attaching to the parent, because...

input: Make sure stat info are created before attaching to the parent, because stats_ComputeGlobalStats() may vlc_list_find() the input before the stat have been initialized.
parent e77d9061
......@@ -283,6 +283,16 @@ static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item,
p_input->p->b_owns_its_sout = VLC_FALSE;
}
/* Initialize optional stream output. (before access/demuxer)
* XXX: we add a special case if the uri starts by vlc.
* else 'vlc in.file --sout "" vlc:quit' cannot work (the output will
* be destroyed in case of a file).
* (this will break playing of file starting by 'vlc:' but I don't
* want to add more logic, just force file by file:// or code it ;)
*/
memset( &p_input->p->counters, 0, sizeof( p_input->p->counters ) );
vlc_mutex_init( p_input, &p_input->p->counters.counters_lock );
/* Attach only once we are ready */
vlc_object_attach( p_input, p_parent );
......@@ -307,6 +317,8 @@ static void Destructor( input_thread_t * p_input )
sout_DeleteInstance( priv->p_sout );
}
vlc_mutex_destroy( &p_input->p->counters.counters_lock );
vlc_mutex_destroy( &priv->lock_control );
free( priv );
}
......@@ -761,16 +773,6 @@ static int Init( input_thread_t * p_input )
int i_es_out_mode;
int i, i_delay;
/* Initialize optional stream output. (before access/demuxer)
* XXX: we add a special case if the uri starts by vlc.
* else 'vlc in.file --sout "" vlc:quit' cannot work (the output will
* be destroyed in case of a file).
* (this will break playing of file starting by 'vlc:' but I don't
* want to add more logic, just force file by file:// or code it ;)
*/
memset( &p_input->p->counters, 0, sizeof( p_input->p->counters ) );
vlc_mutex_init( p_input, &p_input->p->counters.counters_lock );
for( i = 0; i < p_input->p->input.p_item->i_options; i++ )
{
if( !strncmp( p_input->p->input.p_item->ppsz_options[i], "meta-file", 9 ) )
......@@ -1341,8 +1343,6 @@ static void End( input_thread_t * p_input )
TAB_CLEAN( p_input->p->i_attachment, p_input->p->attachment );
}
vlc_mutex_destroy( &p_input->p->counters.counters_lock );
/* Tell we're dead */
p_input->b_dead = VLC_TRUE;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment