[vlc-devel] commit: playlist: Define playlist_CurrentInput(), that returns current playing input. (Pierre d'Herbemont )

git version control git at videolan.org
Sat Jul 5 15:47:49 CEST 2008


vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Sat Jul  5 15:10:03 2008 +0200| [d90d8b7da24381831dcf067618836e4cb4a5bb05]

playlist: Define playlist_CurrentInput(), that returns current playing input.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d90d8b7da24381831dcf067618836e4cb4a5bb05
---

 include/vlc_playlist.h |    5 +++++
 src/libvlccore.sym     |    1 +
 src/playlist/engine.c  |   12 ++++++++++++
 3 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/include/vlc_playlist.h b/include/vlc_playlist.h
index 4983b0b..2490a13 100644
--- a/include/vlc_playlist.h
+++ b/include/vlc_playlist.h
@@ -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 )
 
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 68438ae..7bdadda 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -244,6 +244,7 @@ playlist_BothAddInput
 playlist_ChildSearchName
 playlist_Clear
 playlist_Control
+playlist_CurrentInput
 playlist_DeleteFromInput
 playlist_DeleteInputInParent
 playlist_Export
diff --git a/src/playlist/engine.c b/src/playlist/engine.c
index 93b3bcd..ed909a8 100644
--- a/src/playlist/engine.c
+++ b/src/playlist/engine.c
@@ -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;
+}
+
 
 /**
  * @}




More information about the vlc-devel mailing list