[vlc-commits] playlist: move pl_Get()

Rémi Denis-Courmont git at videolan.org
Mon Nov 26 23:19:52 CET 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Nov 26 18:16:18 2012 +0200| [deadb40d1486e07b5ebdf6496f69b0d6ebae6b08] | committer: Rémi Denis-Courmont

playlist: move pl_Get()

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

 src/playlist/control.c |   21 ---------------------
 src/playlist/engine.c  |   20 ++++++++++++++++++++
 2 files changed, 20 insertions(+), 21 deletions(-)

diff --git a/src/playlist/control.c b/src/playlist/control.c
index a9f1177..6096a85 100644
--- a/src/playlist/control.c
+++ b/src/playlist/control.c
@@ -39,27 +39,6 @@ static int PlaylistVAControl( playlist_t * p_playlist, int i_query, va_list args
  * Playlist control
  *****************************************************************************/
 
-static vlc_mutex_t global_lock = VLC_STATIC_MUTEX;
-
-#undef pl_Get
-playlist_t *pl_Get (vlc_object_t *obj)
-{
-    playlist_t *pl;
-    libvlc_int_t *p_libvlc = obj->p_libvlc;
-
-    vlc_mutex_lock (&global_lock);
-    pl = libvlc_priv (p_libvlc)->p_playlist;
-    assert (pl != NULL);
-
-    if (!libvlc_priv (p_libvlc)->playlist_active)
-    {
-         playlist_Activate (pl);
-         libvlc_priv (p_libvlc)->playlist_active = true;
-    }
-    vlc_mutex_unlock (&global_lock);
-    return pl;
-}
-
 void playlist_Lock( playlist_t *pl )
 {
     vlc_mutex_lock( &pl_priv(pl)->lock );
diff --git a/src/playlist/engine.c b/src/playlist/engine.c
index efd3ebc..3a72621 100644
--- a/src/playlist/engine.c
+++ b/src/playlist/engine.c
@@ -357,6 +357,26 @@ void playlist_Destroy( playlist_t *p_playlist )
     vlc_object_release( p_playlist );
 }
 
+#undef pl_Get
+playlist_t *pl_Get (vlc_object_t *obj)
+{
+    static vlc_mutex_t lock = VLC_STATIC_MUTEX;
+    libvlc_int_t *p_libvlc = obj->p_libvlc;
+    playlist_t *pl;
+
+    vlc_mutex_lock (&lock);
+    pl = libvlc_priv (p_libvlc)->p_playlist;
+    assert (pl != NULL);
+
+    if (!libvlc_priv (p_libvlc)->playlist_active)
+    {
+         playlist_Activate (pl);
+         libvlc_priv (p_libvlc)->playlist_active = true;
+    }
+    vlc_mutex_unlock (&lock);
+    return pl;
+}
+
 /** Get current playing input.
  */
 input_thread_t * playlist_CurrentInput( playlist_t * p_playlist )



More information about the vlc-commits mailing list