[vlc-commits] playlist: move SD loading/unloading to playlist code...

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


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Nov 27 00:01:11 2012 +0200| [388ed0d5963f9a2b9b0b539294a5117da1eeec1c] | committer: Rémi Denis-Courmont

playlist: move SD loading/unloading to playlist code...

...instead of libvlc.c. Note that this only concerns the playlist SD.
The LibVLC SD were always dealt with separately.

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

 src/libvlc.c          |   19 +------------------
 src/playlist/engine.c |   13 +++++++++++++
 2 files changed, 14 insertions(+), 18 deletions(-)

diff --git a/src/libvlc.c b/src/libvlc.c
index 9a3d03c..716f752 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -452,16 +452,6 @@ dbus_out:
     }
 #endif
 
-    /* Add service discovery modules */
-    psz_modules = var_InheritString( p_libvlc, "services-discovery" );
-    if( psz_modules )
-    {
-        char *p = psz_modules, *m;
-        while( ( m = strsep( &p, " :," ) ) != NULL )
-            playlist_ServicesDiscoveryAdd( pl_Get(p_libvlc), m );
-        free( psz_modules );
-    }
-
 #ifdef ENABLE_VLM
     /* Initialize VLM if vlm-conf is specified */
     psz_parser = var_CreateGetNonEmptyString( p_libvlc, "vlm-conf" );
@@ -587,14 +577,6 @@ dbus_out:
 void libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
 {
     libvlc_priv_t *priv = libvlc_priv (p_libvlc);
-    playlist_t    *p_playlist = libvlc_priv (p_libvlc)->p_playlist;
-
-    /* Remove all services discovery */
-    if( p_playlist != NULL )
-    {
-        msg_Dbg( p_libvlc, "removing all services discovery tasks" );
-        playlist_ServicesDiscoveryKillAll( p_playlist );
-    }
 
     /* Ask the interfaces to stop and destroy them */
     msg_Dbg( p_libvlc, "removing all interfaces" );
@@ -620,6 +602,7 @@ void libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
 #endif
 
     /* Free playlist now, all threads are gone */
+    playlist_t *p_playlist = libvlc_priv (p_libvlc)->p_playlist;
     if( p_playlist != NULL )
         playlist_Destroy( p_playlist );
 
diff --git a/src/playlist/engine.c b/src/playlist/engine.c
index dc5b0e9..c4aa7c8 100644
--- a/src/playlist/engine.c
+++ b/src/playlist/engine.c
@@ -304,6 +304,16 @@ static playlist_t *playlist_Create( vlc_object_t *p_parent )
     /* Thread */
     playlist_Activate (p_playlist);
 
+    /* Add service discovery modules */
+    char *mods = var_InheritString( p_playlist, "services-discovery" );
+    if( mods != NULL )
+    {
+        char *p = mods, *m;
+        while( (m = strsep( &p, " :," )) != NULL )
+            playlist_ServicesDiscoveryAdd( p_playlist, m );
+        free( mods );
+    }
+
     return p_playlist;
 }
 
@@ -318,6 +328,9 @@ void playlist_Destroy( playlist_t *p_playlist )
 {
     playlist_private_t *p_sys = pl_priv(p_playlist);
 
+    /* Remove all services discovery */
+    playlist_ServicesDiscoveryKillAll( p_playlist );
+
     msg_Dbg( p_playlist, "destroying" );
 
     playlist_Deactivate( p_playlist );



More information about the vlc-commits mailing list