[vlc-devel] [PATCH 2/2] playlist: remove playlist_Deactivate() public usage

Thomas Guillem thomas at gllm.fr
Tue Aug 23 09:45:22 CEST 2016


playlist_Deactivate() is now called before interfaces are destroyed.
---
 include/vlc_playlist.h               | 1 -
 modules/gui/qt/qt.cpp                | 1 -
 modules/gui/skins2/src/skin_main.cpp | 3 ---
 src/libvlccore.sym                   | 1 -
 src/playlist/playlist_internal.h     | 1 +
 src/playlist/thread.c                | 9 +++++----
 6 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/include/vlc_playlist.h b/include/vlc_playlist.h
index 4363405..9e3e190 100644
--- a/include/vlc_playlist.h
+++ b/include/vlc_playlist.h
@@ -280,7 +280,6 @@ enum {
 VLC_API void playlist_Lock( playlist_t * );
 VLC_API void playlist_Unlock( playlist_t * );
 VLC_API void playlist_AssertLocked( playlist_t * );
-VLC_API void playlist_Deactivate( playlist_t * );
 
 /**
  * Do a playlist action.
diff --git a/modules/gui/qt/qt.cpp b/modules/gui/qt/qt.cpp
index 07b4b3a..40a8a77 100644
--- a/modules/gui/qt/qt.cpp
+++ b/modules/gui/qt/qt.cpp
@@ -440,7 +440,6 @@ static void Close( vlc_object_t *p_this )
 
         var_Destroy (pl, "window");
         var_Destroy (pl, "qt4-iface");
-        playlist_Deactivate (pl); /* release window provider if needed */
     }
 
     /* And quit */
diff --git a/modules/gui/skins2/src/skin_main.cpp b/modules/gui/skins2/src/skin_main.cpp
index 8f3da3c..650da53 100644
--- a/modules/gui/skins2/src/skin_main.cpp
+++ b/modules/gui/skins2/src/skin_main.cpp
@@ -149,9 +149,6 @@ static void Close( vlc_object_t *p_this )
 
     msg_Dbg( p_intf, "closing skins2 module" );
 
-    /* Terminate input to ensure that our window provider is released. */
-    playlist_Deactivate( p_intf->p_sys->p_playlist );
-
     vlc_mutex_lock( &skin_load.mutex );
     skin_load.intf = NULL;
     vlc_mutex_unlock( &skin_load.mutex);
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index ae86025..ba8a88d 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -333,7 +333,6 @@ playlist_Clear
 playlist_Control
 playlist_CurrentInput
 playlist_CurrentPlayingItem
-playlist_Deactivate
 playlist_DeleteFromInput
 playlist_Export
 playlist_GetNextLeaf
diff --git a/src/playlist/playlist_internal.h b/src/playlist/playlist_internal.h
index d655dc3..15de7ea 100644
--- a/src/playlist/playlist_internal.h
+++ b/src/playlist/playlist_internal.h
@@ -99,6 +99,7 @@ typedef struct playlist_private_t
 playlist_t *playlist_Create( vlc_object_t * );
 void playlist_Destroy( playlist_t * );
 void playlist_Activate( playlist_t * );
+void playlist_Deactivate( playlist_t * );
 
 /* */
 playlist_item_t *playlist_ItemNewFromInput( playlist_t *p_playlist,
diff --git a/src/playlist/thread.c b/src/playlist/thread.c
index 5e198a0..42c8dba 100644
--- a/src/playlist/thread.c
+++ b/src/playlist/thread.c
@@ -69,10 +69,11 @@ void playlist_Deactivate( playlist_t *p_playlist )
     playlist_private_t *p_sys = pl_priv(p_playlist);
 
     PL_LOCK;
-    /* WARNING: There is a latent bug. It is assumed that only one thread will
-     * be waiting for playlist deactivation at a time. So far, that works
-     * as playlist_Deactivate() is only ever called while closing an
-     * interface and interfaces are shut down serially by intf_DestroyAll(). */
+
+    /* It is assumed that only one thread will be waiting for playlist
+     * deactivation at a time. So far, that works as playlist_Deactivate() is
+     * only ever called from libvlc_InternalCleanup() or from
+     * playlist_Destroy(), that are called from the same thread. */
     if( p_sys->killed )
     {
         PL_UNLOCK;
-- 
2.8.1



More information about the vlc-devel mailing list