/*****************************************************************************
* engine.c : Run the playlist and handle its control
*****************************************************************************
- * Copyright (C) 1999-2007 the VideoLAN team
- * $Id$
+ * Copyright (C) 1999-2008 the VideoLAN team
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Clément Stenac <zorglub@videolan.org>
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 )
}
}
+/** 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;
+}
+
/**
* @}
*/
void playlist_LastLoop( playlist_t *p_playlist )
{
- vlc_object_t *p_obj;
-
/* If there is an input, kill it */
while( 1 )
{
#endif
/* Core should have terminated all SDs before the playlist */
- assert( p_playlist->i_sds == 0 );
+ /* TODO: It fails to do so when not playing anything -- Courmisch */
+ playlist_ServicesDiscoveryKillAll( p_playlist );
playlist_MLDump( p_playlist );
PL_LOCK;
val.i_int = -1;
var_Set( p_playlist, "playlist-current", val );
- var_Create( p_playlist, "intf-popupmenu", VLC_VAR_BOOL );
-
var_Create( p_playlist, "activity", VLC_VAR_INTEGER );
var_SetInteger( p_playlist, "activity", 0 );