[vlc-devel] commit: Variables fixes ( Rémi Denis-Courmont )

git version control git at videolan.org
Sun Jan 31 00:09:04 CET 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jan 31 00:46:58 2010 +0200| [bbb25382d9057fc86b1270d061126ce6f697d0d6] | committer: Rémi Denis-Courmont 

Variables fixes

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

 src/libvlc.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/libvlc.c b/src/libvlc.c
index 3ffade5..5cb74d8 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -807,14 +807,16 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
     playlist_Activate( p_playlist );
 
     /* Add service discovery modules */
-    psz_modules = var_CreateGetNonEmptyString( p_playlist, "services-discovery" );
+    psz_modules = var_InheritString( p_libvlc, "services-discovery" );
     if( psz_modules )
     {
         char *p = psz_modules, *m;
+        playlist_t *p_playlist = pl_Hold( p_libvlc );
         while( ( m = strsep( &p, " :," ) ) != NULL )
             playlist_ServicesDiscoveryAdd( p_playlist, m );
+        free( psz_modules );
+        pl_Release (p_playlist);
     }
-    free( psz_modules );
 
 #ifdef ENABLE_VLM
     /* Initialize VLM if vlm-conf is specified */
@@ -924,7 +926,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
 #ifdef WIN32
     if( var_InheritBool( p_libvlc, "prefer-system-codecs") )
     {
-        char *psz_codecs = var_CreateGetNonEmptyString( p_playlist, "codec" );
+        char *psz_codecs = var_CreateGetNonEmptyString( p_libvlc, "codec" );
         if( psz_codecs )
         {
             char *psz_morecodecs;
@@ -965,15 +967,15 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
     /*
      * Get --open argument
      */
-    psz_val = var_CreateGetNonEmptyString( p_libvlc, "open" );
+    psz_val = var_InheritString( p_libvlc, "open" );
     if ( psz_val != NULL )
     {
         playlist_t *p_playlist = pl_Hold( p_libvlc );
         playlist_AddExt( p_playlist, psz_val, NULL, PLAYLIST_INSERT, 0,
                          -1, 0, NULL, 0, true, pl_Unlocked );
         pl_Release( p_libvlc );
+        free( psz_val );
     }
-    free( psz_val );
 
     return VLC_SUCCESS;
 }




More information about the vlc-devel mailing list