[vlc-commits] VLC: make sure the playlist exists before starting any interface

Rémi Denis-Courmont git at videolan.org
Sun Dec 9 21:27:08 CET 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Dec  9 22:26:22 2012 +0200| [1c672e57519890ad1a2c22feafb67b862a91f561] | committer: Rémi Denis-Courmont

VLC: make sure the playlist exists before starting any interface

This avoids creating the playlist from the UI mainloop, which is not
typically a good idea.

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

 lib/core.c     |   18 ------------------
 lib/playlist.c |   15 +++++++++++++++
 2 files changed, 15 insertions(+), 18 deletions(-)

diff --git a/lib/core.c b/lib/core.c
index 9fc0697..411bdc5 100644
--- a/lib/core.c
+++ b/lib/core.c
@@ -111,24 +111,6 @@ void libvlc_release( libvlc_instance_t *p_instance )
     }
 }
 
-int libvlc_add_intf( libvlc_instance_t *p_i, const char *name )
-{
-    if( libvlc_InternalAddIntf( p_i->p_libvlc_int, name ))
-    {
-        if( name )
-        {
-            libvlc_printerr("interface \"%s\" initialization failed",
-                name );
-        }
-        else
-        {
-            libvlc_printerr("default interface initialization failed");
-        }
-        return -1;
-    }
-    return 0;
-}
-
 void libvlc_set_exit_handler( libvlc_instance_t *p_i, void (*cb) (void *),
                               void *data )
 {
diff --git a/lib/playlist.c b/lib/playlist.c
index 6fe1b31..698d66b 100644
--- a/lib/playlist.c
+++ b/lib/playlist.c
@@ -50,3 +50,18 @@ void libvlc_playlist_play( libvlc_instance_t *p_instance, int i_id,
         return;
     playlist_Control( pl, PLAYLIST_PLAY, false );
 }
+
+int libvlc_add_intf( libvlc_instance_t *p_instance, const char *name )
+{
+    pl_Get (p_instance->p_libvlc_int);
+
+    if( libvlc_InternalAddIntf( p_instance->p_libvlc_int, name ))
+    {
+        if( name != NULL )
+            libvlc_printerr("interface \"%s\" initialization failed", name );
+        else
+            libvlc_printerr("default interface initialization failed");
+        return -1;
+    }
+    return 0;
+}



More information about the vlc-commits mailing list