libavformat/file: return AVERROR_EOF on EOF

Signed-off-by: Daniel Kucera <daniel.kucera@gmail.com>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Daniel Kucera 2017-06-05 20:30:16 +02:00 committed by Michael Niedermayer
parent d4a900fad8
commit c557718bea

View File

@ -112,6 +112,8 @@ static int file_read(URLContext *h, unsigned char *buf, int size)
ret = read(c->fd, buf, size);
if (ret == 0 && c->follow)
return AVERROR(EAGAIN);
if (ret == 0)
return AVERROR_EOF;
return (ret == -1) ? AVERROR(errno) : ret;
}