diff --git a/libavformat/unix.c b/libavformat/unix.c index 4f01d14a93..38016dbafe 100644 --- a/libavformat/unix.c +++ b/libavformat/unix.c @@ -111,6 +111,8 @@ static int unix_read(URLContext *h, uint8_t *buf, int size) return ret; } ret = recv(s->fd, buf, size, 0); + if (!ret && s->type == SOCK_STREAM) + return AVERROR_EOF; return ret < 0 ? ff_neterrno() : ret; }