From c76374c6db5f486672f9df223f43e4892bd655c9 Mon Sep 17 00:00:00 2001 From: Nicolas George Date: Sun, 13 Mar 2011 00:42:27 +0100 Subject: Use AVERROR_EXIT with url_interrupt_cb. Functions interrupted by url_interrupt_cb should not be restarted. Therefore using AVERROR(EINTR) was wrong, as it did not allow to distinguish when the underlying system call was interrupted and actually needed to be restarted. This fixes roundup issues 2657 and 2659 (ffplay not exiting for streamed content). Signed-off-by: Nicolas George Signed-off-by: Ronald S. Bultje --- libavformat/tcp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libavformat/tcp.c') diff --git a/libavformat/tcp.c b/libavformat/tcp.c index b01f0b85bf..83529dfcc4 100644 --- a/libavformat/tcp.c +++ b/libavformat/tcp.c @@ -73,8 +73,10 @@ static int tcp_open(URLContext *h, const char *uri, int flags) if (ret < 0) { struct pollfd p = {fd, POLLOUT, 0}; if (ff_neterrno() == AVERROR(EINTR)) { - if (url_interrupt_cb()) + if (url_interrupt_cb()) { + ret = AVERROR_EXIT; goto fail1; + } goto redo; } if (ff_neterrno() != AVERROR(EINPROGRESS) && @@ -84,7 +86,7 @@ static int tcp_open(URLContext *h, const char *uri, int flags) /* wait until we are connected or until abort */ for(;;) { if (url_interrupt_cb()) { - ret = AVERROR(EINTR); + ret = AVERROR_EXIT; goto fail1; } ret = poll(&p, 1, 100); -- cgit v1.2.3