]> git.sesse.net Git - vlc/blobdiff - modules/misc/playlist/m3u.c
Input access locking, part 2.
[vlc] / modules / misc / playlist / m3u.c
index eb7071af8a493a761cda34a9717bc0cfb316caa0..5d00746448e91f034b7f403a890fe8e4bf3c2afc 100644 (file)
@@ -65,13 +65,11 @@ static void DoChildren( playlist_t *p_playlist, playlist_export_t *p_export,
         assert( p_current->p_input->psz_uri );
 
         /* General info */
-        if( p_current->p_input->psz_name &&
-             strcmp( p_current->p_input->psz_uri,
-                     p_current->p_input->psz_name ) )
+        char *psz_name = input_item_GetName( p_current->p_input );
+        if( psz_name && strcmp( p_current->p_input->psz_uri, psz_name ) )
         {
-            char *psz_artist = input_item_GetArtist( p_current->p_input ) ?
-                               strdup( input_item_GetArtist( p_current->p_input ) ):
-                               strdup( "" );
+            char *psz_artist = input_item_GetArtist( p_current->p_input );
+            if( psz_artist == NULL ) psz_artist = strdup( "" );
             if( psz_artist && *psz_artist )
             {
                 /* write EXTINF with artist */
@@ -87,9 +85,9 @@ static void DoChildren( playlist_t *p_playlist, playlist_export_t *p_export,
                          (int)( p_current->p_input->i_duration/1000000 ),
                           p_current->p_input->psz_name);
             }
-            if( psz_artist )
-                free( psz_artist );
+            free( psz_artist );
         }
+        free( psz_name );
 
         /* VLC specific options */
         for( j = 0; j < p_current->p_input->i_options; j++ )