]> git.sesse.net Git - vlc/commitdiff
Add libvlc_media_list_player_retain() to libvlc.
authorAlexey Sokolov <alexey@alexeysokolov.co.cc>
Tue, 31 May 2011 08:00:20 +0000 (15:00 +0700)
committerRémi Duraffort <ivoire@videolan.org>
Sat, 18 Jun 2011 13:32:20 +0000 (15:32 +0200)
There was only release() before.

Signed-off-by: Rémi Duraffort <ivoire@videolan.org>
include/vlc/libvlc_media_list_player.h
src/control/media_list_player.c
src/libvlc.sym

index a488562ca6bc4d86a5ceded871c14120cf3b8e0c..66ccca69a1c920f5c541c6af5296760084fd3d53 100644 (file)
@@ -68,13 +68,26 @@ LIBVLC_API libvlc_media_list_player_t *
     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
  */
 LIBVLC_API void
     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.
  *
index a6d509869119c9eb33c94a04ca67d8ece623fa5d..343866bb75eea21dd4725eb72aa6009429fde6c8 100644 (file)
@@ -519,6 +519,19 @@ void libvlc_media_list_player_release(libvlc_media_list_player_t * 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)
  **************************************************************************/
index d04a69ef435d4d7a3078ef36a88923d7ac55f6c4..8e3d835e338eee534ff27016e789fcd133f33630 100644 (file)
@@ -95,6 +95,7 @@ libvlc_media_list_player_play_item
 libvlc_media_list_player_play_item_at_index
 libvlc_media_list_player_previous
 libvlc_media_list_player_release
+libvlc_media_list_player_retain
 libvlc_media_list_player_set_media_list
 libvlc_media_list_player_set_media_player
 libvlc_media_list_player_set_playback_mode