Commit 0d80c1cf authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

playlist: add playlist_CurrentInputLocked()

parent bfc41c35
......@@ -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.
*/
......
......@@ -337,6 +337,7 @@ playlist_ChildSearchName
playlist_Clear
playlist_Control
playlist_CurrentInput
playlist_CurrentInputLocked
playlist_CurrentPlayingItem
playlist_Deactivate
playlist_DeleteFromInput
......
......@@ -358,14 +358,26 @@ void playlist_Destroy( playlist_t *p_playlist )
vlc_object_release( 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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment