[vlc-devel] [PATCH 10/14] core: libvlc: Let the medialibrary outlive the playlist

Hugo Beauzée-Luyssen hugo at beauzee.fr
Mon Sep 23 11:44:53 CEST 2019


As we will save the playback states in the media library from the
player, we need to ensure the media library is still available when
doing so.
Since the last save can occur while destroying the player and it's
associated input, we need the media library to be destroyed after the
player, and therefor the playlist.
---
 src/libvlc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/libvlc.c b/src/libvlc.c
index 23da60c6f7..2d370deab8 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -398,9 +398,6 @@ void libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
     if ( priv->p_thumbnailer )
         vlc_thumbnailer_Release( priv->p_thumbnailer );
 
-    if ( priv->p_media_library )
-        libvlc_MlRelease( priv->p_media_library );
-
     if( priv->media_source_provider )
         vlc_media_source_provider_Delete( priv->media_source_provider );
 
@@ -433,6 +430,9 @@ void libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
     if (priv->main_playlist)
         vlc_playlist_Delete(priv->main_playlist);
 
+    if ( priv->p_media_library )
+        libvlc_MlRelease( priv->p_media_library );
+
     libvlc_InternalActionsClean( p_libvlc );
 
     /* Save the configuration */
-- 
2.20.1



More information about the vlc-devel mailing list