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 <nicolas.george@normalesup.org> Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
This commit is contained in:
committed by
Ronald S. Bultje
parent
bafa4dd3e6
commit
c76374c6db
@ -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);
|
||||
|
Reference in New Issue
Block a user