Commit 42a0d047 authored by Rafaël Carré's avatar Rafaël Carré

Attach the sout object to libvlc

parent fb388c46
...@@ -1413,18 +1413,11 @@ static sout_instance_t *SoutFind( vlc_object_t *p_parent, input_item_t *p_item, ...@@ -1413,18 +1413,11 @@ 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 */ * XXX it might be unusable but this will be checked later */
if( b_keep_sout ) if( b_keep_sout )
{ {
/* Remove the sout from the playlist garbage collector */ p_sout = vlc_object_find( p_parent->p_libvlc, VLC_OBJECT_SOUT,
/* FIXME: we don't want to depend on the playlist, sout FIND_CHILD );
* should be attached to libvlc */
playlist_t * p_playlist = vlc_object_find( p_parent,
VLC_OBJECT_PLAYLIST, FIND_PARENT );
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 )
{ {
if( p_sout->p_parent != VLC_OBJECT(p_playlist) ) if( p_sout->p_parent != VLC_OBJECT( p_sout->p_libvlc ) )
{ {
vlc_object_release( p_sout ); vlc_object_release( p_sout );
p_sout = NULL; p_sout = NULL;
...@@ -1432,14 +1425,9 @@ static sout_instance_t *SoutFind( vlc_object_t *p_parent, input_item_t *p_item, ...@@ -1432,14 +1425,9 @@ static sout_instance_t *SoutFind( vlc_object_t *p_parent, input_item_t *p_item,
else else
{ {
vlc_object_detach( p_sout ); /* Remove it from the GC */ vlc_object_detach( p_sout ); /* Remove it from the GC */
vlc_object_release( p_sout ); vlc_object_release( p_sout );
} }
} }
vlc_mutex_unlock( &p_playlist->gc_lock );
vlc_object_release( p_playlist );
}
} }
if( pb_sout_keep ) if( pb_sout_keep )
...@@ -1450,16 +1438,8 @@ static sout_instance_t *SoutFind( vlc_object_t *p_parent, input_item_t *p_item, ...@@ -1450,16 +1438,8 @@ static sout_instance_t *SoutFind( vlc_object_t *p_parent, input_item_t *p_item,
static void SoutKeep( sout_instance_t *p_sout ) static void SoutKeep( sout_instance_t *p_sout )
{ {
/* FIXME: we don't want to depend on the playlist, sout
* should be attached to libvlc */
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" ); msg_Dbg( p_sout, "sout has been kept" );
vlc_object_attach( p_sout, p_playlist ); vlc_object_attach( p_sout, p_sout->p_libvlc );
pl_Release( p_sout );
} }
/***************************************************************************** /*****************************************************************************
......
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