diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2011-03-04 23:43:02 +0100 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2011-03-07 14:56:25 -0500 |
commit | 688c22e033a48ebf84fb4b52642bbd40f11e9c4e (patch) | |
tree | 2163a12da2a1eb4c5562ac3eda6cb45b1d9c3636 /libavformat/avio.c | |
parent | 789936dbbda60990220b80769ed75702775ea0b2 (diff) | |
download | ffmpeg-688c22e033a48ebf84fb4b52642bbd40f11e9c4e.tar.gz |
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>
Diffstat (limited to 'libavformat/avio.c')
-rw-r--r-- | libavformat/avio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/avio.c b/libavformat/avio.c index 4ab1b6bd75..2265549266 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -221,8 +221,6 @@ static inline int retry_transfer_wrapper(URLContext *h, unsigned char *buf, int len = 0; while (len < size_min) { - if (url_interrupt_cb()) - return AVERROR(EINTR); ret = transfer_func(h, buf+len, size-len); if (ret == AVERROR(EINTR)) continue; @@ -239,6 +237,8 @@ static inline int retry_transfer_wrapper(URLContext *h, unsigned char *buf, int if (ret) fast_retries = FFMAX(fast_retries, 2); len += ret; + if (url_interrupt_cb()) + return AVERROR(EINTR); } return len; } |