[FFmpeg-devel] [PATCH] avio: Check for FF_NETERROR(EAGAIN) in retry_transfer_wrapper

Martin Storsjö martin
Tue Feb 22 09:15:54 CET 2011


On Mon, 21 Feb 2011, Nicolas George wrote:

> Le tridi 3 vent?se, an CCXIX, Ronald S. Bultje a ?crit?:
> > Can we map them to self-defined error codes on Windows? Made-up
> > values, is what I mean.
> 
> What about using the same values as currently, on a case-by-case basis:
> 
> #ifndef ECONNREFUSED
> #define ECONNREFUSED WSAECONNREFUSED
> #endif
> 
> ?

That might be a good idea, but I'm not totally convinced. Do we want this 
in libavutil/error.h, or internally within lavf somewhere?

In libavutil/error.h we can't conditionally include winsock2.h depending 
on HAVE_WINSOCK2_H. (That'd also only work for windows, not for any other, 
hypothetical system that lacks these particular error codes, not sure if 
any such exist though.)

If we define this internally within lavf, we don't have that issue, but 
then it's much less obvious for the caller that he should check the return 
values against these error codes.

> >			  I know that won't act well with strerror(),
> 
> Does it currently work? Does windows strerror translate WSAE*? If it does,
> the above solution would work too.

I'm not sure that it works at the moment...

// Martin



More information about the ffmpeg-devel mailing list