[FFmpeg-devel] [PATCH] Add a way to unblock tcp_open() when host is not responding.

Thomas Guillem thomas.guillem
Tue Dec 14 15:06:50 CET 2010


The attached patch allow to unblock the thread calling tcp_open() when the host
is not responding.

The only way I found to cancel a blocking network operation (like tcp_open())
is to set a flag in an other thread, send a signal (SIGUSR1) to the main process
and have url_interrupt_cb() returning 1 if the previous flag is set.

But the previous solution didn't work when the thread was blocked in connect()
function (when the host is not responding). So I added a check to
url_interrupt_cb() when connect is interrupted by a signal in order to leave the

Thomas Guillem
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tcp_open.diff
Type: text/x-patch
Size: 612 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101214/3aa4f329/attachment.bin>

More information about the ffmpeg-devel mailing list