mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-11-03 09:41:17 +08: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
@@ -135,19 +135,20 @@ static int concat_read(URLContext *h, unsigned char *buf, int size)
|
||||
|
||||
while (size > 0) {
|
||||
result = ffurl_read(nodes[i].uc, buf, size);
|
||||
if (result < 0)
|
||||
return total ? total : result;
|
||||
if (!result) {
|
||||
if (result == AVERROR_EOF) {
|
||||
if (i + 1 == data->length ||
|
||||
ffurl_seek(nodes[++i].uc, 0, SEEK_SET) < 0)
|
||||
break;
|
||||
result = 0;
|
||||
}
|
||||
if (result < 0)
|
||||
return total ? total : result;
|
||||
total += result;
|
||||
buf += result;
|
||||
size -= result;
|
||||
}
|
||||
data->current = i;
|
||||
return total;
|
||||
return total ? total : result;
|
||||
}
|
||||
|
||||
static int64_t concat_seek(URLContext *h, int64_t pos, int whence)
|
||||
|
||||
Reference in New Issue
Block a user