summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@lavabit.com>2009-02-07 19:51:02 +0100
committerLars-Dominik Braun <PromyLOPh@lavabit.com>2009-02-07 19:51:02 +0100
commitb27163360b463f16715f9fd72ca8817fad3d2d46 (patch)
tree1410c2f47e275b27a8343e3868d913f791850da3 /src
parentfcb1d460d459242dc30d033305db2cb9bf313f5e (diff)
downloadpianobar-windows-b27163360b463f16715f9fd72ca8817fad3d2d46.tar.gz
pianobar-windows-b27163360b463f16715f9fd72ca8817fad3d2d46.tar.bz2
pianobar-windows-b27163360b463f16715f9fd72ca8817fad3d2d46.zip
Fix mp3 time display
Diffstat (limited to 'src')
-rw-r--r--src/player.c6
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);
}