Commit a8712a37 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

Fix sout leak if the playlist is gone

parent 49708746
......@@ -325,10 +325,7 @@ static void Destructor( input_thread_t * p_input )
if( priv->b_sout_keep )
SoutKeep( priv->p_sout );
else
{
sout_DeleteInstance( priv->p_sout );
priv->p_sout = NULL;
}
}
#endif
vlc_gc_decref( p_input->p->input.p_item );
......@@ -1454,12 +1451,14 @@ static void SoutKeep( sout_instance_t *p_sout )
{
playlist_t * p_playlist = vlc_object_find( p_sout, VLC_OBJECT_PLAYLIST,
FIND_PARENT );
if( !p_playlist ) return;
msg_Dbg( p_sout, "sout has been kept" );
vlc_object_attach( p_sout, p_playlist );
vlc_object_release( p_playlist );
if( p_playlist )
{
msg_Dbg( p_sout, "sout has been kept" );
vlc_object_attach( p_sout, p_playlist );
vlc_object_release( p_playlist );
}
else
sout_DeleteInstance( p_sout );
}
/*****************************************************************************
......
Supports Markdown
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