[vlc-commits] playlist: add playlist_CurrentInputLocked()
Rémi Denis-Courmont
git at videolan.org
Tue Nov 15 21:04:44 CET 2016
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Nov 15 21:19:37 2016 +0200| [0d80c1cff4581efb81081dff48ce5acfe33b2299] | committer: Rémi Denis-Courmont
playlist: add playlist_CurrentInputLocked()
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0d80c1cff4581efb81081dff48ce5acfe33b2299
---
include/vlc_playlist.h | 1 +
src/libvlccore.sym | 1 +
src/playlist/engine.c | 16 ++++++++++++++--
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/include/vlc_playlist.h b/include/vlc_playlist.h
index a85f064..79fd3ea 100644
--- a/include/vlc_playlist.h
+++ b/include/vlc_playlist.h
@@ -288,6 +288,7 @@ VLC_API void playlist_Control( playlist_t *p_playlist, int i_query, bool b_locke
/** Get current playing input. The object is retained.
*/
VLC_API input_thread_t * playlist_CurrentInput( playlist_t *p_playlist ) VLC_USED;
+VLC_API input_thread_t *playlist_CurrentInputLocked( playlist_t *p_playlist ) VLC_USED;
/** Get the duration of all items in a node.
*/
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index eeed931..fbb2b85 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -337,6 +337,7 @@ playlist_ChildSearchName
playlist_Clear
playlist_Control
playlist_CurrentInput
+playlist_CurrentInputLocked
playlist_CurrentPlayingItem
playlist_Deactivate
playlist_DeleteFromInput
diff --git a/src/playlist/engine.c b/src/playlist/engine.c
index 1f29ee4..4275c3a 100644
--- a/src/playlist/engine.c
+++ b/src/playlist/engine.c
@@ -360,12 +360,24 @@ void playlist_Destroy( playlist_t *p_playlist )
/** Get current playing input.
*/
+input_thread_t *playlist_CurrentInputLocked( playlist_t *p_playlist )
+{
+ PL_ASSERT_LOCKED;
+
+ input_thread_t *p_input = pl_priv(p_playlist)->p_input;
+ if( p_input != NULL )
+ vlc_object_hold( p_input );
+ return p_input;
+}
+
+
+/** Get current playing input.
+ */
input_thread_t * playlist_CurrentInput( playlist_t * p_playlist )
{
input_thread_t * p_input;
PL_LOCK;
- p_input = pl_priv(p_playlist)->p_input;
- if( p_input ) vlc_object_hold( p_input );
+ p_input = playlist_CurrentInputLocked( p_playlist );
PL_UNLOCK;
return p_input;
}
More information about the vlc-commits
mailing list