Qt4 - MainInterface, Don't show remaining time when length is 0.
authorJean-Baptiste Kempf <jb@videolan.org>
Wed, 7 Nov 2007 02:11:30 +0000 (02:11 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Wed, 7 Nov 2007 02:11:30 +0000 (02:11 +0000)
modules/gui/qt4/main_interface.cpp

index 8d7da5e..c2f778e 100644 (file)
@@ -655,11 +655,12 @@ void MainInterface::setDisplayPosition( float pos, int time, int length )
 {
     char psz_length[MSTRTIME_MAX_SIZE], psz_time[MSTRTIME_MAX_SIZE];
     secstotimestr( psz_length, length );
-    secstotimestr( psz_time, b_remainingTime ? length - time : time );
+    secstotimestr( psz_time, ( b_remainingTime && length ) ? length - time
+                                                           : time );
 
     QString title; title.sprintf( "%s/%s", psz_time, psz_length );
     /* Add a minus to remaining time*/
-    if( b_remainingTime ) timeLabel->setText( " -"+title+" " );
+    if( b_remainingTime && length ) timeLabel->setText( " -"+title+" " );
     else timeLabel->setText( " "+title+" " );
 }