]> git.sesse.net Git - vlc/commitdiff
playlist: add real functions for locking
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Sat, 17 Jan 2009 17:19:51 +0000 (19:19 +0200)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Sat, 17 Jan 2009 17:20:12 +0000 (19:20 +0200)
include/vlc_playlist.h
modules/control/http/mvar.c
modules/control/http/rpn.c
modules/gui/qt4/qt4.hpp
modules/gui/skins2/commands/cmd_input.cpp
modules/gui/skins2/vars/playtree.cpp
modules/gui/wxwidgets/wxwidgets.hpp
src/libvlccore.sym
src/playlist/control.c

index 4a885e55ee3acc77e8fbaa762100815f7e07acd3..b93f128139ae54fd5b44984c16f75bd1e2eb3b11 100644 (file)
@@ -221,9 +221,9 @@ enum pl_locked_state
  *****************************************************************************/
 
 /* Helpers */
-#define PL_LOCK vlc_object_lock( p_playlist )
-#define PL_UNLOCK vlc_object_unlock( p_playlist )
-#define PL_ASSERT_LOCKED vlc_object_assert_locked( p_playlist )
+#define PL_LOCK playlist_Lock( p_playlist )
+#define PL_UNLOCK playlist_Unlock( p_playlist )
+#define PL_ASSERT_LOCKED playlist_AssertLocked( p_playlist )
 
 VLC_EXPORT( playlist_t *, __pl_Hold, ( vlc_object_t * ) );
 #define pl_Hold( a ) __pl_Hold( VLC_OBJECT(a) )
@@ -239,6 +239,10 @@ VLC_EXPORT( void, __pl_Release, ( vlc_object_t * ) );
 #define playlist_Prev(p) playlist_Control(p,PLAYLIST_SKIP, pl_Unlocked, -1)
 #define playlist_Skip(p,i) playlist_Control(p,PLAYLIST_SKIP, pl_Unlocked,  (i) )
 
+VLC_EXPORT( void, playlist_Lock, ( playlist_t * ) );
+VLC_EXPORT( void, playlist_Unlock, ( playlist_t * ) );
+VLC_EXPORT( void, playlist_AssertLocked, ( playlist_t * ) );
+
 /**
  * Do a playlist action.
  * If there is something in the playlist then you can do playlist actions.
index eead1fe5707cba3a63883c00cb925f428b9e09a0..c25dd34d29cd6b2c9ae17b55d7003ffdcafd4a27 100644 (file)
@@ -287,9 +287,9 @@ mvar_t *mvar_PlaylistSetNew( intf_thread_t *p_intf, char *name,
                                  playlist_t *p_pl )
 {
     mvar_t *s = mvar_New( name, "set" );
-    vlc_object_lock( p_pl );
+    playlist_Lock( p_pl );
     PlaylistListNode( p_intf, p_pl, p_pl->p_root_category , name, s, 0 );
-    vlc_object_unlock( p_pl );
+    playlist_Unlock( p_pl );
     return s;
 }
 
index fa4e6d39dcd0147d87879f210d25fadd90398e89..50aa5e8a79f5911fd0bfc706f86c707c5195ceba 100644 (file)
@@ -494,12 +494,12 @@ void EvaluateRPN( intf_thread_t *p_intf, mvar_t  *vars,
             int i_id = SSPopN( st, vars );
             int i_ret;
 
-            vlc_object_lock( p_sys->p_playlist );
+            playlist_Lock( p_sys->p_playlist );
             i_ret = playlist_Control( p_sys->p_playlist, PLAYLIST_VIEWPLAY,
                                       pl_Locked, NULL,
                                       playlist_ItemGetById( p_sys->p_playlist,
                                       i_id, pl_Locked ) );
-            vlc_object_unlock( p_sys->p_playlist );
+            playlist_Unlock( p_sys->p_playlist );
             msg_Dbg( p_intf, "requested playlist item: %i", i_id );
             SSPushN( st, i_ret );
         }
index 45d116bbaed4e561515ce80fcb20f31f13b75dbc..32a6ab6768a73eb464b4e4f9f578d3d90d3477a4 100644 (file)
@@ -76,8 +76,8 @@ struct intf_sys_t
 };
 
 #define THEPL p_intf->p_sys->p_playlist
-#define QPL_LOCK vlc_object_lock( THEPL );
-#define QPL_UNLOCK vlc_object_unlock( THEPL );
+#define QPL_LOCK playlist_Lock( THEPL );
+#define QPL_UNLOCK playlist_Unlock( THEPL );
 
 #define THEDP DialogsProvider::getInstance()
 #define THEMIM MainInputManager::getInstance( p_intf )
index 76a8eab5d8cab8a2bc760e24bfd864dfa14deb4a..4e76107aca827621d8fd9ec0d964de81f56de0fa 100644 (file)
@@ -36,9 +36,9 @@ void CmdPlay::execute()
         return;
     }
 
-    vlc_object_lock( pPlaylist );
+    playlist_Lock( pPlaylist );
     const bool b_empty = playlist_IsEmpty( pPlaylist );
-    vlc_object_unlock( pPlaylist );
+    playlist_Unlock( pPlaylist );
 
     if( !b_empty )
     {
index a15676bfa825b2a2e6f93c52d1437d2d2b8232da..405f0726ce081bd5d37ecbacd4ffe50435bf4747 100644 (file)
@@ -52,7 +52,7 @@ Playtree::~Playtree()
 void Playtree::delSelected()
 {
     Iterator it = begin();
-    vlc_object_lock( getIntf()->p_sys->p_playlist );
+    playlist_Lock( getIntf()->p_sys->p_playlist );
     for( it = begin(); it != end(); it = getNextVisibleItem( it ) )
     {
         if( (*it).m_selected && !(*it).isReadonly() )
@@ -93,12 +93,12 @@ void Playtree::delSelected()
             it = getNextVisibleItem( it );
         }
     }
-    vlc_object_unlock( getIntf()->p_sys->p_playlist );
+    playlist_Unlock( getIntf()->p_sys->p_playlist );
 }
 
 void Playtree::action( VarTree *pItem )
 {
-    vlc_object_lock( m_pPlaylist );
+    playlist_Lock( m_pPlaylist );
     VarTree::Iterator it;
 
     playlist_item_t *p_item = (playlist_item_t *)pItem->m_pData;
@@ -114,7 +114,7 @@ void Playtree::action( VarTree *pItem )
     {
         playlist_Control( m_pPlaylist, PLAYLIST_VIEWPLAY, pl_Locked, p_parent, p_item );
     }
-    vlc_object_unlock( m_pPlaylist );
+    playlist_Unlock( m_pPlaylist );
 }
 
 void Playtree::onChange()
@@ -213,7 +213,7 @@ void Playtree::buildNode( playlist_item_t *pNode, VarTree &rTree )
 void Playtree::buildTree()
 {
     clear();
-    vlc_object_lock( m_pPlaylist );
+    playlist_Lock( m_pPlaylist );
 
     i_items_to_append = 0;
 
@@ -228,7 +228,7 @@ void Playtree::buildTree()
 
     buildNode( m_pPlaylist->p_root_category, *this );
 
-    vlc_object_unlock( m_pPlaylist );
+    playlist_Unlock( m_pPlaylist );
 //  What is it ?
 //    checkParents( NULL );
 }
index 39e433b97c14c2b31d13fc246d84d8854a2f7c2c..58fd5270209db8cd081c7baef1684a22fb6ef7bf 100644 (file)
@@ -225,13 +225,13 @@ wxWindow *CreateDialogsProvider( intf_thread_t *p_intf, wxWindow *p_parent );
 inline void LockPlaylist( intf_sys_t *p_sys, playlist_t *p_pl )
 {
     if( p_sys->i_playlist_usage++ == 0)
-        vlc_object_lock( p_pl );
+        playlist_lock( p_pl );
 }
 
 inline void UnlockPlaylist( intf_sys_t *p_sys, playlist_t *p_pl )
 {
     if( --p_sys->i_playlist_usage == 0)
-        vlc_object_unlock( p_pl );
+        playlist_Unlock( p_pl );
 }
 
 #endif
index 6bedd0532d3139928d4fd10871ef80c2c18d363c..78c72ce45434eda5326f45710902da573933e330 100644 (file)
@@ -275,6 +275,7 @@ playlist_Add
 playlist_AddExt
 playlist_AddInput
 playlist_AskForArtEnqueue
+playlist_AssertLocked
 playlist_BothAddInput
 playlist_ChildSearchName
 playlist_Clear
@@ -297,6 +298,7 @@ playlist_ItemGetByInputId
 playlist_ItemNewWithType
 playlist_ItemToNode
 playlist_LiveSearchUpdate
+playlist_Lock
 playlist_NodeAppend
 playlist_NodeChildrenCount
 playlist_NodeCreate
@@ -311,6 +313,7 @@ playlist_ServicesDiscoveryAdd
 playlist_ServicesDiscoveryRemove
 playlist_Status
 playlist_TreeMove
+playlist_Unlock
 __pl_Hold
 __pl_Release
 resolve_xml_special_chars
index a3f87c61eafff68e70f7c2dee5b51de6d0f403c7..f9260e072a92ba636e1ec6740abdb16ff1c38fd0 100644 (file)
@@ -66,6 +66,21 @@ void __pl_Release( vlc_object_t *p_this )
     vlc_object_release( pl );
 }
 
+void playlist_Lock( playlist_t *pl )
+{
+    vlc_object_lock( pl );
+}
+
+void playlist_Unlock( playlist_t *pl )
+{
+    vlc_object_unlock( pl );
+}
+
+void playlist_AssertLocked( playlist_t *pl )
+{
+    vlc_object_assert_locked( pl );
+}
+
 int playlist_Control( playlist_t * p_playlist, int i_query,
                       bool b_locked, ... )
 {