Commit 153deb49 authored by Yoann Peronneau's avatar Yoann Peronneau

* modules/gui/wxwindows/playlist.cpp: when duration is not known, don't display (--:--:--)

parent 8313b721
......@@ -45,7 +45,7 @@ Platform: any
Urgency: Important
Description: proper DVD controls
Most importantly a proper button that will take you straight to the DVD menu. But also, next/prev chapter should be integrated with next/prev playlistitem.
Status: Todo
Status: Assigned to yoann (done)
Task
Difficulty: Easy
......
......@@ -516,26 +516,27 @@ void Playlist::UpdateTreeItem( playlist_t *p_playlist, wxTreeItemId item )
}
wxString msg;
wxString duration = wxU( "" );
char *psz_author = playlist_ItemGetInfo( p_item, _("Meta-information"),
_("Artist"));
char psz_duration[MSTRTIME_MAX_SIZE];
mtime_t dur = p_item->input.i_duration;
if( dur != -1 )
{
secstotimestr( psz_duration, dur/1000000 );
else
memcpy( psz_duration, "-:--:--", sizeof("-:--:--") );
duration.Append( wxU( " ( " ) + wxString( wxU( psz_duration ) ) +
wxU( ")" ) );
}
if( !strcmp( psz_author, "" ) || p_item->input.b_fixed_name == VLC_TRUE )
{
msg.Printf( wxString( wxU( p_item->input.psz_name ) ) + wxU( " ( ") +
wxString(wxU(psz_duration ) ) + wxU( ")") );
msg.Printf( wxString( wxU( p_item->input.psz_name ) ) + duration );
}
else
{
msg.Printf( wxString(wxU( psz_author )) + wxT(" - ") +
wxString(wxU(p_item->input.psz_name)) + wxU( " ( ") +
wxString(wxU(psz_duration ) ) + wxU( ")") );
wxString(wxU(p_item->input.psz_name)) + duration );
}
treectrl->SetItemText( item , msg );
treectrl->SetItemImage( item, p_item->input.i_type );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment