From 7b265f85942f0aaa9a48c5773dff6bd27a6970b3 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Tue, 23 Oct 2012 09:38:57 +0200 Subject: Consider RESERVE_BUFFERS while computing buffer size required for ipecamera fast reject --- ipecamera/ipecamera.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ipecamera/ipecamera.c') diff --git a/ipecamera/ipecamera.c b/ipecamera/ipecamera.c index 2868d6b..27bea77 100644 --- a/ipecamera/ipecamera.c +++ b/ipecamera/ipecamera.c @@ -128,8 +128,8 @@ pcilib_context_t *ipecamera_init(pcilib_t *pcilib) { #ifdef IPECAMERA_BUG_POSTPONED_READ GET_REG(max_frames_reg, value); - if (value >= ctx->buffer_size) { - ctx->buffer_size = value + 1; + if ((value + IPECAMERA_RESERVE_BUFFERS + 3) > ctx->buffer_size) { + ctx->buffer_size = (value + 1) + IPECAMERA_RESERVE_BUFFERS + 2; } #endif /* IPECAMERA_BUG_POSTPONED_READ */ -- cgit v1.2.3