From b27163360b463f16715f9fd72ca8817fad3d2d46 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Sat, 7 Feb 2009 19:51:02 +0100 Subject: Fix mp3 time display --- src/player.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/player.c') 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); } -- cgit v1.2.3