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 ...@@ -45,7 +45,7 @@ Platform: any
Urgency: Important Urgency: Important
Description: proper DVD controls 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. 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 Task
Difficulty: Easy Difficulty: Easy
......
...@@ -516,26 +516,27 @@ void Playlist::UpdateTreeItem( playlist_t *p_playlist, wxTreeItemId item ) ...@@ -516,26 +516,27 @@ void Playlist::UpdateTreeItem( playlist_t *p_playlist, wxTreeItemId item )
} }
wxString msg; wxString msg;
wxString duration = wxU( "" );
char *psz_author = playlist_ItemGetInfo( p_item, _("Meta-information"), char *psz_author = playlist_ItemGetInfo( p_item, _("Meta-information"),
_("Artist")); _("Artist"));
char psz_duration[MSTRTIME_MAX_SIZE]; char psz_duration[MSTRTIME_MAX_SIZE];
mtime_t dur = p_item->input.i_duration; mtime_t dur = p_item->input.i_duration;
if( dur != -1 ) if( dur != -1 )
{
secstotimestr( psz_duration, dur/1000000 ); secstotimestr( psz_duration, dur/1000000 );
else duration.Append( wxU( " ( " ) + wxString( wxU( psz_duration ) ) +
memcpy( psz_duration, "-:--:--", sizeof("-:--:--") ); wxU( ")" ) );
}
if( !strcmp( psz_author, "" ) || p_item->input.b_fixed_name == VLC_TRUE ) if( !strcmp( psz_author, "" ) || p_item->input.b_fixed_name == VLC_TRUE )
{ {
msg.Printf( wxString( wxU( p_item->input.psz_name ) ) + wxU( " ( ") + msg.Printf( wxString( wxU( p_item->input.psz_name ) ) + duration );
wxString(wxU(psz_duration ) ) + wxU( ")") );
} }
else else
{ {
msg.Printf( wxString(wxU( psz_author )) + wxT(" - ") + msg.Printf( wxString(wxU( psz_author )) + wxT(" - ") +
wxString(wxU(p_item->input.psz_name)) + wxU( " ( ") + wxString(wxU(p_item->input.psz_name)) + duration );
wxString(wxU(psz_duration ) ) + wxU( ")") );
} }
treectrl->SetItemText( item , msg ); treectrl->SetItemText( item , msg );
treectrl->SetItemImage( item, p_item->input.i_type ); 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