* 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 );
- if( p_sout )
+ playlist_t *p_playlist = vlc_object_find( p_parent->p_libvlc,
+ VLC_OBJECT_PLAYLIST, FIND_CHILD );
+ if( p_playlist )
{
- if( p_sout->p_parent != VLC_OBJECT( p_sout->p_libvlc ) )
- {
- vlc_object_release( p_sout );
- p_sout = NULL;
- }
- else
+ vlc_mutex_lock( &p_playlist->gc_lock );
+ p_sout = vlc_object_find( p_playlist, VLC_OBJECT_SOUT, FIND_CHILD );
+ if( p_sout )
{
- vlc_object_detach( p_sout ); /* Remove it from the GC */
- vlc_object_release( p_sout );
+ if( p_sout->p_parent != VLC_OBJECT( p_playlist ) )
+ {
+ vlc_object_release( p_sout );
+ p_sout = NULL;
+ }
+ else
+ {
+ vlc_object_detach( p_sout ); /* Remove it from the GC */
+ vlc_object_release( p_sout );
+ }
}
+ vlc_mutex_unlock( &p_playlist->gc_lock );
+ vlc_object_release( p_playlist );
}
}
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 );
}
/*****************************************************************************
}
#ifdef ENABLE_SOUT
+ playlist_t * p_playlist;
sout_instance_t * p_sout;
- p_sout = vlc_object_find( p_libvlc, VLC_OBJECT_SOUT, FIND_CHILD );
- if( p_sout )
+ p_playlist = vlc_object_find( p_libvlc, VLC_OBJECT_PLAYLIST, FIND_CHILD );
+ if( p_playlist )
{
- msg_Dbg( p_sout, "removing kept stream output" );
- vlc_object_detach( (vlc_object_t*)p_sout );
- vlc_object_release( (vlc_object_t*)p_sout );
- sout_DeleteInstance( p_sout );
+ p_sout = vlc_object_find( p_playlist, VLC_OBJECT_SOUT, FIND_CHILD );
+ if( p_sout )
+ {
+ msg_Dbg( p_sout, "removing kept stream output" );
+ vlc_object_detach( (vlc_object_t*)p_sout );
+ vlc_object_release( (vlc_object_t*)p_sout );
+ sout_DeleteInstance( p_sout );
+ }
+
+ vlc_object_release( p_playlist );
}
/* Destroy VLM if created in libvlc_InternalInit */