Changeset 4844:47f0daf6b214 in roaraudio for roarclients


Ignore:
Timestamp:
04/05/11 00:27:40 (13 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

Fixed time display of roarvorbis if file has unknown playback length

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roarclients/roarvorbis.c

    r4754 r4844  
    264264 
    265265 time2str(time_cur, time_buf[0], sizeof(time_buf[0])); 
    266  time2str(time_total-time_cur, time_buf[1], sizeof(time_buf[1])); 
    267  time2str(time_total, time_buf[2], sizeof(time_buf[2])); 
    268  
    269  //Time: 00:02.53 [03:26.20] of 03:28.73  (122.7 kbps)  Output Buffer  43.8% 
    270  fprintf(stderr, "\rTime: %s [%s] of %s  (%.1f kbps)            ", time_buf[0], time_buf[1], time_buf[2], bitrate); 
     266 
     267 if ( time_total > 0 ) { 
     268  time2str(time_total-time_cur, time_buf[1], sizeof(time_buf[1])); 
     269  time2str(time_total, time_buf[2], sizeof(time_buf[2])); 
     270 
     271  //Time: 00:02.53 [03:26.20] of 03:28.73  (122.7 kbps)  Output Buffer  43.8% 
     272  fprintf(stderr, "\rTime: %s [%s] of %s  (%.1f kbps)            ", time_buf[0], time_buf[1], time_buf[2], bitrate); 
     273 } else { 
     274  fprintf(stderr, "\rTime: %s  (%.1f kbps)                       ", time_buf[0], bitrate); 
     275 } 
     276 
    271277 fflush(stderr); 
    272278} 
Note: See TracChangeset for help on using the changeset viewer.