Commit c557718b authored by Daniel Kucera's avatar Daniel Kucera Committed by Michael Niedermayer

libavformat/file: return AVERROR_EOF on EOF

Signed-off-by: 's avatarDaniel Kucera <daniel.kucera@gmail.com>
Reviewed-by: 's avatarNicolas George <george@nsup.org>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent d4a900fa
...@@ -112,6 +112,8 @@ static int file_read(URLContext *h, unsigned char *buf, int size) ...@@ -112,6 +112,8 @@ static int file_read(URLContext *h, unsigned char *buf, int size)
ret = read(c->fd, buf, size); ret = read(c->fd, buf, size);
if (ret == 0 && c->follow) if (ret == 0 && c->follow)
return AVERROR(EAGAIN); return AVERROR(EAGAIN);
if (ret == 0)
return AVERROR_EOF;
return (ret == -1) ? AVERROR(errno) : ret; return (ret == -1) ? AVERROR(errno) : ret;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment