Commit db493e33 authored by Alexey Sokolov's avatar Alexey Sokolov Committed by Rémi Duraffort

Add libvlc_media_list_player_retain() to libvlc.

There was only release() before.
Signed-off-by: default avatarRémi Duraffort <ivoire@videolan.org>
parent 2a36bfd0
...@@ -68,13 +68,26 @@ LIBVLC_API libvlc_media_list_player_t * ...@@ -68,13 +68,26 @@ LIBVLC_API libvlc_media_list_player_t *
libvlc_media_list_player_new( libvlc_instance_t * p_instance ); libvlc_media_list_player_new( libvlc_instance_t * p_instance );
/** /**
* Release media_list_player. * Release a media_list_player after use
* Decrement the reference count of a media player object. If the
* reference count is 0, then libvlc_media_list_player_release() will
* release the media player object. If the media player object
* has been released, then it should not be used again.
* *
* \param p_mlp media list player instance * \param p_mlp media list player instance
*/ */
LIBVLC_API void LIBVLC_API void
libvlc_media_list_player_release( libvlc_media_list_player_t * p_mlp ); libvlc_media_list_player_release( libvlc_media_list_player_t * p_mlp );
/**
* Retain a reference to a media player list object. Use
* libvlc_media_list_player_release() to decrement reference count.
*
* \param p_mlp media player list object
*/
LIBVLC_API void
libvlc_media_list_player_retain( libvlc_media_list_player_t *p_mlp );
/** /**
* Return the event manager of this media_list_player. * Return the event manager of this media_list_player.
* *
......
...@@ -519,6 +519,19 @@ void libvlc_media_list_player_release(libvlc_media_list_player_t * p_mlp) ...@@ -519,6 +519,19 @@ void libvlc_media_list_player_release(libvlc_media_list_player_t * p_mlp)
free(p_mlp); free(p_mlp);
} }
/**************************************************************************
* retain (Public)
**************************************************************************/
void libvlc_media_list_player_retain(libvlc_media_list_player_t * p_mlp)
{
if (!p_mlp)
return;
lock(p_mlp);
p_mlp->i_refcount++;
unlock(p_mlp);
}
/************************************************************************** /**************************************************************************
* event_manager (Public) * event_manager (Public)
**************************************************************************/ **************************************************************************/
......
...@@ -95,6 +95,7 @@ libvlc_media_list_player_play_item ...@@ -95,6 +95,7 @@ libvlc_media_list_player_play_item
libvlc_media_list_player_play_item_at_index libvlc_media_list_player_play_item_at_index
libvlc_media_list_player_previous libvlc_media_list_player_previous
libvlc_media_list_player_release libvlc_media_list_player_release
libvlc_media_list_player_retain
libvlc_media_list_player_set_media_list libvlc_media_list_player_set_media_list
libvlc_media_list_player_set_media_player libvlc_media_list_player_set_media_player
libvlc_media_list_player_set_playback_mode libvlc_media_list_player_set_playback_mode
......
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