diff options
author | Thomas Guillem <thomas.guillem@gmail.com> | 2010-12-14 23:03:05 +0000 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2010-12-14 23:03:05 +0000 |
commit | 1aa58c6405dad2663257260b993791f43c0da76b (patch) | |
tree | 46ee02058edf79a67dd8fd3236fac0a6d5041bdd /libavformat/tcp.c | |
parent | 06f6f78578f67a57a07367168e451d58b8e665fe (diff) | |
download | ffmpeg-1aa58c6405dad2663257260b993791f43c0da76b.tar.gz |
tcp: Check url_interrupt_cb if connect was interrupted by a signal
This makes it possible to abort a blocking connect call.
Patch by Thomas Guillem, thomas dot guillem at gmail
Originally committed as revision 26014 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/tcp.c')
-rw-r--r-- | libavformat/tcp.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/tcp.c b/libavformat/tcp.c index 4ab64e4549..14b5e19cd9 100644 --- a/libavformat/tcp.c +++ b/libavformat/tcp.c @@ -73,8 +73,11 @@ static int tcp_open(URLContext *h, const char *uri, int flags) redo: ret = connect(fd, cur_ai->ai_addr, cur_ai->ai_addrlen); if (ret < 0) { - if (ff_neterrno() == FF_NETERROR(EINTR)) + if (ff_neterrno() == FF_NETERROR(EINTR)) { + if (url_interrupt_cb()) + goto fail1; goto redo; + } if (ff_neterrno() != FF_NETERROR(EINPROGRESS) && ff_neterrno() != FF_NETERROR(EAGAIN)) goto fail; |