retry_transfer_wrapper: only call interrupt callback when less than requested is...
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 4 Apr 2011 23:58:03 +0000 (01:58 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 4 Apr 2011 23:58:03 +0000 (01:58 +0200)
Its a waste of cpu cycles otherwise

libavformat/avio.c

index 5dca68a..491ebc1 100644 (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 (ret)
            fast_retries = FFMAX(fast_retries, 2);
         len += ret;
-        if (url_interrupt_cb())
+        if (len < size && url_interrupt_cb())
             return AVERROR_EXIT;
     }
     return len;
             return AVERROR_EXIT;
     }
     return len;