diff options
-rw-r--r-- | ipecamera/ipecamera.c | 4 |
1 files changed, 2 insertions, 2 deletions
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 */ |