summaryrefslogtreecommitdiffstats
path: root/ipecamera/events.c
diff options
context:
space:
mode:
Diffstat (limited to 'ipecamera/events.c')
-rw-r--r--ipecamera/events.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ipecamera/events.c b/ipecamera/events.c
index 33a1e7f..58c29a1 100644
--- a/ipecamera/events.c
+++ b/ipecamera/events.c
@@ -53,7 +53,7 @@ int ipecamera_stream(pcilib_context_t *vctx, pcilib_event_callback_t callback, v
#else /* IPECAMERA_ANNOUNCE_READY */
while (ctx->reported_id != ctx->event_id) {
#endif /* IPECAMERA_ANNOUNCE_READY */
- if ((ctx->event_id - ctx->reported_id) > (ctx->buffer_size - IPECAMERA_RESERVE_BUFFERS)) ctx->reported_id = ctx->event_id - (ctx->buffer_size - 1) - IPECAMERA_RESERVE_BUFFERS;
+ if ((ctx->event_id - ctx->reported_id) > (ctx->buffer_size - IPECAMERA_RESERVE_BUFFERS)) ctx->reported_id = ctx->event_id - (ctx->buffer_size - 1 - IPECAMERA_RESERVE_BUFFERS);
else ++ctx->reported_id;
memcpy(&info, ctx->frame + ((ctx->reported_id-1)%ctx->buffer_size), sizeof(ipecamera_event_info_t));