diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2009-10-01 21:14:39 +0200 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2009-10-01 21:14:39 +0200 |
commit | 00e09ae4c805345f4dacdfabb9a03ed04311944c (patch) | |
tree | f89d1e6ccd6e21a5df5285a920df5adc2f57f4c0 /main.c | |
parent | 6303b539693d1c3aa58c0164e5a9799953abef41 (diff) |
fixed playback of http mp3 streams with unknown length
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -111,7 +111,15 @@ update_songinfo (void) { songpos = playpos; codec_unlock (); - snprintf (sbtext_new, 512, "[%s] %dHz | %d bit | %s | %d:%02d / %d:%02d | %d songs total", str_playing_song.filetype ? str_playing_song.filetype:"-", samplerate, bitspersample, mode, minpos, secpos, mindur, secdur, pl_getcount ()); + char t[100]; + if (str_playing_song.duration >= 0) { + snprintf (t, sizeof (t), "%d:%02d", mindur, secdur); + } + else { + strcpy (t, "-:--"); + } + + snprintf (sbtext_new, 512, "[%s] %dHz | %d bit | %s | %d:%02d / %s | %d songs total", str_playing_song.filetype ? str_playing_song.filetype:"-", samplerate, bitspersample, mode, minpos, secpos, t, pl_getcount ()); } if (strcmp (sbtext_new, sb_text)) { |