diff options
author | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2009-02-07 19:51:02 +0100 |
---|---|---|
committer | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2009-02-07 19:51:02 +0100 |
commit | b27163360b463f16715f9fd72ca8817fad3d2d46 (patch) | |
tree | 1410c2f47e275b27a8343e3868d913f791850da3 | |
parent | fcb1d460d459242dc30d033305db2cb9bf313f5e (diff) | |
download | pianobar-b27163360b463f16715f9fd72ca8817fad3d2d46.tar.gz pianobar-b27163360b463f16715f9fd72ca8817fad3d2d46.tar.bz2 pianobar-b27163360b463f16715f9fd72ca8817fad3d2d46.zip |
Fix mp3 time display
-rw-r--r-- | src/player.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/player.c b/src/player.c index fc7fa46..06f3ec3 100644 --- a/src/player.c +++ b/src/player.c @@ -465,6 +465,12 @@ void *BarPlayerThread (void *data) { do { /* if curl failed, setup new headers _everytime_ (the range changed) */ if (curlRet == CURLE_PARTIAL_FILE) { + /* don't calc song length from content-length header again (wrong + * time would be shown otherwise as the reported content-length is + * smaller than the whole file actually is -- we're going to + * receive partial content!) */ + curl_easy_setopt (player->audioFd, CURLOPT_HEADERFUNCTION, NULL); + curl_easy_setopt (player->audioFd, CURLOPT_WRITEHEADER, NULL); curl_easy_setopt (player->audioFd, CURLOPT_RESUME_FROM, player->bytesReceived); } |