diff options
author | Daniel Kucera <daniel.kucera@gmail.com> | 2017-10-17 10:29:30 +0200 |
---|---|---|
committer | Nicolas George <george@nsup.org> | 2017-10-19 22:07:21 +0200 |
commit | 858db4b01fa2b55ee55056c033054ca54ac9b0fd (patch) | |
tree | 5a29252c4545b4ff80bb0beead0628812d0b73b9 /libavformat/concat.c | |
parent | f4090940bd3024e69d236257d327f11d1e496229 (diff) | |
download | ffmpeg-858db4b01fa2b55ee55056c033054ca54ac9b0fd.tar.gz |
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>
Diffstat (limited to 'libavformat/concat.c')
-rw-r--r-- | libavformat/concat.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libavformat/concat.c b/libavformat/concat.c index 46b520fe80..19c83c309a 100644 --- a/libavformat/concat.c +++ b/libavformat/concat.c @@ -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) |