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>
pull/263/head
Daniel Kucera 8 years ago committed by Michael Niedermayer
parent d4a900fad8
commit c557718bea
  1. 2
      libavformat/file.c

@ -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;
}

Loading…
Cancel
Save