[FFmpeg-devel] [PATCH 1/2] Add 'rw_timeout' into URLContext

Andrey Utkin andrey.krieger.utkin at gmail.com
Wed Aug 29 06:56:05 CEST 2012

2012/8/29 jamal <jamrial at gmail.com>:
> This broke compilation for mingw when using --disable-network
> CC      libavformat/avio.o
> libavformat/avio.c: In function 'retry_transfer_wrapper':
> libavformat/avio.c:275:32: error: 'ETIMEDOUT' undeclared (first use in this function)
> libavformat/avio.c:275:32: note: each undeclared identifier is reported only once for each function it appears in
> make: *** [libavformat/avio.o] Error 1
> make: *** Waiting for unfinished jobs....
> ETIMEDOUT for Windows is declared in network.h

Thanks for report.
I have ideas of:
1) ifdef-ing retry_transfer_wrapper to plain call to transfer_func if
networking disabled. But what if in future we have a protocol for
asynchronous work with local files? Especially because remote
filesystems happen. Non-blocking, r/w approach can be handy not only
for network i/o. Bad solution to me.
2) Include network.h unconditionally to avio.c. The simplest &
shortest, but somewhat incorrect solution.
3) Replace ETIMEDOUT with EAGAIN in return statement. Acceptable, but
not elegant to me.
4) Something like the below...
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -27,6 +27,8 @@
 #include "avformat.h"
 #include "network.h"
+#elif (!defined ETIMEDOUT)
 #include "url.h"

Andrey Utkin

More information about the ffmpeg-devel mailing list