On Tue, 26 Apr 2011, Martin Storsjö wrote:

> On Tue, 26 Apr 2011, Gil Pedersen wrote:
> 
> > Attached patch will allow ff_network_wait_fd() to return when the fd 
> > encounters an error or disconnection (HUP). Once returned, the next 
> > read/write call on the fd will result in an error and possibly a signal, 
> > which should provide better feedback than the current method of waiting 
> > indefinitely.
> 
> > diff --git a/libavformat/network.h b/libavformat/network.h
> > index 84a8f53..37ef22e 100644
> > --- a/libavformat/network.h
> > +++ b/libavformat/network.h
> > @@ -78,7 +78,7 @@ static inline int ff_network_wait_fd(int fd, int write)
> >      struct pollfd p = { .fd = fd, .events = ev, .revents = 0 };
> >      int ret;
> >      ret = poll(&p, 1, 100);
> > -    return ret < 0 ? ff_neterrno() : p.revents & ev ? 0 : AVERROR(EAGAIN);
> > +    return ret < 0 ? ff_neterrno() : p.revents & (ev | POLLERR | POLLHUP) 
> > ? 0 : AVERROR(EAGAIN);
> >  }
> >  
> >  static inline void ff_network_close(void)
> 
> Looks ok to me.

Pushed.

// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to