summaryrefslogtreecommitdiff
path: root/plugins/vfs_curl
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2010-10-30 13:06:26 +0200
committerGravatar waker <wakeroid@gmail.com>2010-10-30 13:06:26 +0200
commit026ab2385c64837dc1c215efea8fb0f87ac2efb5 (patch)
tree39ff0b56abfabf83be38fb9b23aa61175770cae3 /plugins/vfs_curl
parent7b438fb40b1b839f1bdf9b9597dc59730a350d56 (diff)
fixed regression in seeking http streams
Diffstat (limited to 'plugins/vfs_curl')
-rw-r--r--plugins/vfs_curl/vfs_curl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/vfs_curl/vfs_curl.c b/plugins/vfs_curl/vfs_curl.c
index 79040d99..c3a627bd 100644
--- a/plugins/vfs_curl/vfs_curl.c
+++ b/plugins/vfs_curl/vfs_curl.c
@@ -229,6 +229,7 @@ http_curl_write (void *ptr, size_t size, size_t nmemb, void *stream) {
if (!fp->icyheader && avail >= 10 && !memcmp (ptr, "ICY 200 OK", 10)) {
trace ("icy headers in the stream\n");
fp->icyheader = 1;
+ fp->length = -1;
}
if (fp->icyheader) {
if (fp->nheaderpackets > 10) {
@@ -391,7 +392,6 @@ http_content_header_handler (void *ptr, size_t size, size_t nmemb, void *stream)
uint8_t key[256];
uint8_t value[256];
int refresh_playlist = 0;
- fp->length = -1; // reset length on every request/redirect
while (p < end) {
if (p <= end - 4) {
if (!memcmp (p, "\r\n\r\n", 4)) {
@@ -412,7 +412,9 @@ http_content_header_handler (void *ptr, size_t size, size_t nmemb, void *stream)
fp->content_type = strdup (value);
}
else if (!strcasecmp (key, "Content-Length")) {
- fp->length = atoi (value);
+ if (!fp->icyheader) { // icy streams must be infinite
+ fp->length = atoi (value);
+ }
}
else if (!strcasecmp (key, "icy-name")) {
if (fp->track) {