mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-11 17:30:00 +01:00
libavformat: not treat 0 as EOF
transfer_func variable passed to retry_transfer_wrapper are h->prot->url_read and h->prot->url_write functions. These need to return EOF or other error properly. In case of returning >= 0, url_read/url_write is retried until error is returned. Signed-off-by: Daniel Kucera <daniel.kucera@gmail.com>
This commit is contained in:
committed by
Nicolas George
parent
f4090940bd
commit
858db4b01f
@@ -201,7 +201,7 @@ static int cache_read(URLContext *h, unsigned char *buf, int size)
|
||||
}
|
||||
|
||||
r = ffurl_read(c->inner, buf, size);
|
||||
if (r == 0 && size>0) {
|
||||
if (r == AVERROR_EOF && size>0) {
|
||||
c->is_true_eof = 1;
|
||||
av_assert0(c->end >= c->logical_pos);
|
||||
}
|
||||
@@ -263,7 +263,7 @@ resolve_eof:
|
||||
if (whence == SEEK_SET)
|
||||
size = FFMIN(sizeof(tmp), pos - c->logical_pos);
|
||||
ret = cache_read(h, tmp, size);
|
||||
if (ret == 0 && whence == SEEK_END) {
|
||||
if (ret == AVERROR_EOF && whence == SEEK_END) {
|
||||
av_assert0(c->is_true_eof);
|
||||
goto resolve_eof;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user