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)