summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@gmail.com>2008-06-22 11:15:13 +0200
committerLars-Dominik Braun <PromyLOPh@gmail.com>2008-06-22 11:15:13 +0200
commit98c2f0b1a22f89dc971472702b3ac4e080183e48 (patch)
treeebdf035c6878579ee1c51601e98f4ca6a7c752a7
parentecc7f3375b887729e45e1e838dbffde44d954b43 (diff)
downloadpianobar-windows-98c2f0b1a22f89dc971472702b3ac4e080183e48.tar.gz
pianobar-windows-98c2f0b1a22f89dc971472702b3ac4e080183e48.tar.bz2
pianobar-windows-98c2f0b1a22f89dc971472702b3ac4e080183e48.zip
client: Fix funny song durations
Don't show time if the player has not initialized our data yet.
-rw-r--r--src/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index a9efb9c..6580afb 100644
--- a/src/main.c
+++ b/src/main.c
@@ -368,7 +368,8 @@ int main (int argc, char **argv) {
} /* end poll */
/* show time */
- if (player.finishedPlayback == 0) {
+ if (player.finishedPlayback == 0 &&
+ player.mode >= SAMPLESIZE_INITIALIZED) {
/* FIXME: is this calculation correct? */
/* one frame length: T = 1/f */
float songLength = 1.0 / (float) player.samplerate *