]> git.sesse.net Git - vlc/commitdiff
playlist: Define playlist_CurrentInput(), that returns current playing input.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Sat, 5 Jul 2008 13:10:03 +0000 (15:10 +0200)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Sat, 5 Jul 2008 13:50:01 +0000 (15:50 +0200)
include/vlc_playlist.h
src/libvlccore.sym
src/playlist/engine.c

index 4983b0b697d92312b534248999eaf648e5c82fd5..2490a136e2d50442773e55bdfcd80d365d1c444f 100644 (file)
@@ -294,6 +294,10 @@ VLC_EXPORT( void, __pl_Release, ( vlc_object_t * ) );
  */
 VLC_EXPORT( int, playlist_Control, ( playlist_t *p_playlist, int i_query, bool b_locked, ...  ) );
 
+/** Get current playing input. The object is retained.
+ */
+VLC_EXPORT( input_thread_t *, playlist_CurrentInput, ( playlist_t *p_playlist ) );
+
 /** Clear the playlist
  * \param b_locked TRUE if playlist is locked when entering this function
  */
@@ -411,6 +415,7 @@ static inline int playlist_Import( playlist_t *p_playlist, const char *psz_file)
     return VLC_SUCCESS;
 }
 
+
 /** Tell if the playlist is currently running */
 #define playlist_IsPlaying( pl ) ( pl->status.i_status == PLAYLIST_RUNNING )
 
index 68438ae157999ebda2a7c42eb9bbdf12982ce9fb..7bdadda752581d3ade1176bf0936e8c62ca97a97 100644 (file)
@@ -244,6 +244,7 @@ playlist_BothAddInput
 playlist_ChildSearchName
 playlist_Clear
 playlist_Control
+playlist_CurrentInput
 playlist_DeleteFromInput
 playlist_DeleteInputInParent
 playlist_Export
index 93b3bcd4c70ea4d1062b5828b7f03870bfb53cbd..ed909a837b4a4061636ef1a361473158ea647900 100644 (file)
@@ -258,6 +258,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;
+}
+
 
 /**
  * @}