[FFmpeg-devel] [PATCH] libavformat/file: return AVERROR_EOF on EOF

Nicolas George george at nsup.org
Thu Jun 15 11:21:00 EEST 2017


Le septidi 17 prairial, an CCXXV, Daniel Kucera a écrit :
> Signed-off-by: Daniel Kucera <daniel.kucera at gmail.com>
> ---
>  libavformat/file.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/libavformat/file.c b/libavformat/file.c
> index 264542a36a..1fb83851c0 100644
> --- a/libavformat/file.c
> +++ b/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;
>  }
>  

LGTM, but I do not maintain that file.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170615/d405532e/attachment.sig>


More information about the ffmpeg-devel mailing list