]> git.sesse.net Git - vlc/blobdiff - modules/gui/wxwidgets/dialogs/playlist.cpp
Input access locking, part 3 (final).
[vlc] / modules / gui / wxwidgets / dialogs / playlist.cpp
index 5d384caa35dee98fa7ac7f7f53426eaac9e82cc6..4649e20c5e3b207321e5ddb03cfd1941eec1d1d3 100644 (file)
@@ -512,11 +512,11 @@ void Playlist::UpdateTreeItem( wxTreeItemId item )
     wxString msg;
     wxString duration = wxU( "" );
 
-    char *psz_artist;
-    psz_artist = input_item_GetArtist( p_item->p_input );
+    char *psz_artist = input_item_GetArtist( p_item->p_input );
+    char *psz_name = input_item_GetName( p_item->p_input );
 
     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 )
     {
@@ -527,14 +527,15 @@ void Playlist::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 );