mirror of https://git.videolan.org/git/ffmpeg.git
In retry_transfer_wrapper, do not check url_interrupt_cb, causes problems
when writing and pressing q during encoding. Instead, check url_interrupt_cb at the end. Note that when a protocol is interrupted by url_interrupt_cb, some data may be silently discarded: the protocol context is not suitable for anything anymore. Signed-off-by: Nicolas George <nicolas.george@normalesup.org> Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
This commit is contained in:
parent
789936dbbd
commit
688c22e033
|
@ -221,8 +221,6 @@ static inline int retry_transfer_wrapper(URLContext *h, unsigned char *buf, int
|
||||||
|
|
||||||
len = 0;
|
len = 0;
|
||||||
while (len < size_min) {
|
while (len < size_min) {
|
||||||
if (url_interrupt_cb())
|
|
||||||
return AVERROR(EINTR);
|
|
||||||
ret = transfer_func(h, buf+len, size-len);
|
ret = transfer_func(h, buf+len, size-len);
|
||||||
if (ret == AVERROR(EINTR))
|
if (ret == AVERROR(EINTR))
|
||||||
continue;
|
continue;
|
||||||
|
@ -239,6 +237,8 @@ static inline int retry_transfer_wrapper(URLContext *h, unsigned char *buf, int
|
||||||
if (ret)
|
if (ret)
|
||||||
fast_retries = FFMAX(fast_retries, 2);
|
fast_retries = FFMAX(fast_retries, 2);
|
||||||
len += ret;
|
len += ret;
|
||||||
|
if (url_interrupt_cb())
|
||||||
|
return AVERROR(EINTR);
|
||||||
}
|
}
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue