]> git.sesse.net Git - vlc/blobdiff - src/playlist/engine.c
pl_Yield(): return NULL when the playlist is gone (or going)
[vlc] / src / playlist / engine.c
index 4cad1f8ebfa6ac44d80e661ae3722120b8134976..f6385d01e3a83f63e0d750f3f1ef4270aa39b50a 100644 (file)
@@ -173,16 +173,11 @@ static void playlist_Destructor( vlc_object_t * p_this )
 
     if( p_playlist->p_fetcher )
         vlc_object_release( p_playlist->p_fetcher );
-#ifndef NDEBUG
-    libvlc_priv (p_this->p_libvlc)->p_playlist = NULL; /* pl_Yield() will fail */
-#endif
 }
 
 /* Destroy remaining objects */
 static void ObjectGarbageCollector( playlist_t *p_playlist, bool b_force )
 {
-    vlc_object_t *p_obj;
-
     if( !b_force )
     {
         if( mdate() - p_playlist->gc_date < 1000000 )
@@ -195,16 +190,6 @@ static void ObjectGarbageCollector( playlist_t *p_playlist, bool b_force )
     }
 
     vlc_mutex_lock( &p_playlist->gc_lock );
-    while( ( p_obj = vlc_object_find( p_playlist->p_libvlc, VLC_OBJECT_VOUT,
-                                                  FIND_CHILD ) ) )
-    {
-        vlc_object_release( p_obj );
-        if( p_obj->p_parent == VLC_OBJECT(p_playlist->p_libvlc) )
-        {
-            msg_Dbg( p_playlist, "garbage collector destroying 1 vout" );
-            vlc_object_release( p_obj ); /* Hmm, is this (thread-)safe?? */
-        }
-    }
     p_playlist->b_cant_sleep = false;
     vlc_mutex_unlock( &p_playlist->gc_lock );
 }
@@ -270,6 +255,18 @@ void playlist_set_current_input(
     }
 }
 
+/** Get current playing input.
+ */
+input_thread_t * playlist_CurrentInput( playlist_t * p_playlist )
+{
+    input_thread_t * p_input;
+    PL_LOCK;
+    p_input = p_playlist->p_input;
+    if( p_input ) vlc_object_yield( p_input );
+    PL_UNLOCK;
+    return p_input;
+}
+
 
 /**
  * @}