Commit 5d0f05ab authored by Sébastien Escudier's avatar Sébastien Escudier Committed by Rémi Denis-Courmont

VLM : Fix a race condition when input event is triggered and...

VLM : Fix a race condition when input event is triggered and vlm_MediaInstanceDelete is called at the same time.
Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
parent c2d2e2bb
......@@ -843,6 +843,7 @@ static void vlm_MediaInstanceDelete( vlm_t *p_vlm, int64_t id, vlm_media_instanc
if( p_instance->p_input_resource )
input_resource_Delete( p_instance->p_input_resource );
TAB_REMOVE( p_media->i_instance, p_media->instance, p_instance );
vlc_gc_decref( p_instance->p_item );
free( p_instance->psz_name );
free( p_instance );
......@@ -950,7 +951,6 @@ static int vlm_ControlMediaInstanceStart( vlm_t *p_vlm, int64_t id, const char *
if( !p_instance->p_input )
{
TAB_REMOVE( p_media->i_instance, p_media->instance, p_instance );
vlm_MediaInstanceDelete( p_vlm, id, p_instance, p_media );
}
else
......@@ -975,8 +975,6 @@ static int vlm_ControlMediaInstanceStop( vlm_t *p_vlm, int64_t id, const char *p
if( !p_instance )
return VLC_EGENERIC;
TAB_REMOVE( p_media->i_instance, p_media->instance, p_instance );
vlm_MediaInstanceDelete( p_vlm, id, p_instance, p_media );
return VLC_SUCCESS;
......
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