summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-10-01 21:14:39 +0200
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-10-01 21:14:39 +0200
commit00e09ae4c805345f4dacdfabb9a03ed04311944c (patch)
treef89d1e6ccd6e21a5df5285a920df5adc2f57f4c0 /main.c
parent6303b539693d1c3aa58c0164e5a9799953abef41 (diff)
fixed playback of http mp3 streams with unknown length
Diffstat (limited to 'main.c')
-rw-r--r--main.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/main.c b/main.c
index 0058213a..a8240659 100644
--- a/main.c
+++ b/main.c
@@ -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)) {