]> git.sesse.net Git - vlc/blobdiff - modules/gui/wxwidgets/playlist_manager.cpp
Input access locking, part 3 (final).
[vlc] / modules / gui / wxwidgets / playlist_manager.cpp
index 9e467e488cd63692d45fe65c0e8847398e6f2cad..aa867879249bd6dc34cdf014e02a1d6b1823d0f1 100644 (file)
@@ -300,13 +300,15 @@ void PlaylistManager::UpdateTreeItem( wxTreeItemId item )
     wxString duration = wxU( "" );
 
     char *psz_artist = input_item_GetArtist( p_item->p_input );
-    if( ! psz_artist )
-    {
-        psz_artist = "";
-    }
+    if( !psz_artist )
+        psz_artist = strdup( "" );
+
+    char *psz_name = input_item_GetName( p_item->p_input );
+    if( !psz_name )
+        psz_name = strdup( "" );
 
     char psz_duration[MSTRTIME_MAX_SIZE];
-    mtime_t dur = p_item->p_input->i_duration;
+    mtime_t dur = input_item_GetDuration( p_item->p_input );
 
     if( dur != -1 )
     {
@@ -317,14 +319,15 @@ void PlaylistManager::UpdateTreeItem( wxTreeItemId item )
 
     if( !strcmp( psz_artist, "" ) || p_item->p_input->b_fixed_name == VLC_TRUE )
     {
-        msg = wxString( wxU( p_item->p_input->psz_name ) ) + duration;
+        msg = wxString( wxU( psz_name ) ) + duration;
     }
     else
     {
         msg = wxString(wxU( psz_artist )) + wxT(" - ") +
-                    wxString(wxU(p_item->p_input->psz_name)) + duration;
+                    wxString(wxU(psz_name)) + duration;
     }
     free( psz_artist );
+    free( psz_name );
     treectrl->SetItemText( item , msg );
     treectrl->SetItemImage( item, p_item->p_input->i_type );