Merge commit '8bf3bf69ad7333bf0c45f4d2797fc2c61bc8922f'

* commit '8bf3bf69ad7333bf0c45f4d2797fc2c61bc8922f':
  http: Stop reading after receiving the whole file for non-chunked transfers

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-08-13 18:26:35 +02:00
commit 9f7a2ecb29
1 changed files with 2 additions and 1 deletions

View File

@ -841,7 +841,8 @@ static int http_buf_read(URLContext *h, uint8_t *buf, int size)
memcpy(buf, s->buf_ptr, len); memcpy(buf, s->buf_ptr, len);
s->buf_ptr += len; s->buf_ptr += len;
} else { } else {
if (!s->willclose && s->filesize >= 0 && s->off >= s->filesize) if ((!s->willclose || s->chunksize < 0) &&
s->filesize >= 0 && s->off >= s->filesize)
return AVERROR_EOF; return AVERROR_EOF;
len = ffurl_read(s->hd, buf, size); len = ffurl_read(s->hd, buf, size);
} }