[FFmpeg-cvslog] lavf/http: fix incorrect warning in range requests
Rodger Combs
git at videolan.org
Thu Nov 26 02:47:34 CET 2015
ffmpeg | branch: master | Rodger Combs <rodger.combs at gmail.com> | Sun Oct 18 17:50:21 2015 -0500| [362c17e6563808ef48655e5ddf59a35b6497b8b2] | committer: Rodger Combs
lavf/http: fix incorrect warning in range requests
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=362c17e6563808ef48655e5ddf59a35b6497b8b2
---
libavformat/http.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/libavformat/http.c b/libavformat/http.c
index 4b4a225..606286a 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -1155,15 +1155,16 @@ static int http_buf_read(URLContext *h, uint8_t *buf, int size)
memcpy(buf, s->buf_ptr, len);
s->buf_ptr += len;
} else {
+ int64_t target_end = s->end_off ? s->end_off : s->filesize;
if ((!s->willclose || s->chunksize < 0) &&
- s->filesize >= 0 && s->off >= s->filesize)
+ target_end >= 0 && s->off >= target_end)
return AVERROR_EOF;
len = ffurl_read(s->hd, buf, size);
if (!len && (!s->willclose || s->chunksize < 0) &&
- s->filesize >= 0 && s->off < s->filesize) {
+ target_end >= 0 && s->off < target_end) {
av_log(h, AV_LOG_ERROR,
"Stream ends prematurely at %"PRId64", should be %"PRId64"\n",
- s->off, s->filesize
+ s->off, target_end
);
return AVERROR(EIO);
}
More information about the ffmpeg-cvslog
mailing list