Commit 4cc4c675 authored by Rafaël Carré's avatar Rafaël Carré

Revert [42a0d047]

The kept sout needs to be attached to the playlist, else we will
try to destroy vlm's souts before it's time to.
parent 22dbee00
......@@ -1419,11 +1419,15 @@ static sout_instance_t *SoutFind( vlc_object_t *p_parent, input_item_t *p_item,
* XXX it might be unusable but this will be checked later */
if( b_keep_sout )
{
p_sout = vlc_object_find( p_parent->p_libvlc, VLC_OBJECT_SOUT,
FIND_CHILD );
playlist_t *p_playlist = vlc_object_find( p_parent->p_libvlc,
VLC_OBJECT_PLAYLIST, FIND_CHILD );
if( p_playlist )
{
vlc_mutex_lock( &p_playlist->gc_lock );
p_sout = vlc_object_find( p_playlist, VLC_OBJECT_SOUT, FIND_CHILD );
if( p_sout )
{
if( p_sout->p_parent != VLC_OBJECT( p_sout->p_libvlc ) )
if( p_sout->p_parent != VLC_OBJECT( p_playlist ) )
{
vlc_object_release( p_sout );
p_sout = NULL;
......@@ -1434,6 +1438,9 @@ static sout_instance_t *SoutFind( vlc_object_t *p_parent, input_item_t *p_item,
vlc_object_release( p_sout );
}
}
vlc_mutex_unlock( &p_playlist->gc_lock );
vlc_object_release( p_playlist );
}
}
if( pb_sout_keep )
......@@ -1444,8 +1451,14 @@ static sout_instance_t *SoutFind( vlc_object_t *p_parent, input_item_t *p_item,
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_sout->p_libvlc );
vlc_object_attach( p_sout, p_playlist );
vlc_object_release( p_playlist );
}
/*****************************************************************************
......
......@@ -960,9 +960,13 @@ int libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
}
#ifdef ENABLE_SOUT
playlist_t * p_playlist;
sout_instance_t * p_sout;
p_sout = vlc_object_find( p_libvlc, VLC_OBJECT_SOUT, FIND_CHILD );
p_playlist = vlc_object_find( p_libvlc, VLC_OBJECT_PLAYLIST, FIND_CHILD );
if( p_playlist )
{
p_sout = vlc_object_find( p_playlist, VLC_OBJECT_SOUT, FIND_CHILD );
if( p_sout )
{
msg_Dbg( p_sout, "removing kept stream output" );
......@@ -971,6 +975,9 @@ int libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
sout_DeleteInstance( p_sout );
}
vlc_object_release( p_playlist );
}
/* Destroy VLM if created in libvlc_InternalInit */
if( priv->p_vlm )
{
......
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