retry_transfer_wrapper: only call interrupt callback when less than requested is r/w.

Its a waste of cpu cycles otherwise
This commit is contained in:
Michael Niedermayer 2011-04-05 01:58:03 +02:00
parent 3e3ea93b3c
commit 6114bffa91

View File

@ -237,7 +237,7 @@ 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())
if (len < size && url_interrupt_cb())
return AVERROR_EXIT;
}
return len;