summaryrefslogtreecommitdiffstats
path: root/ipecamera
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2013-03-26 17:32:07 +0100
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2013-03-26 17:32:07 +0100
commit821a945eafaf63963d56c9bdef773760bea9a41d (patch)
tree41d5be2a995d1331d7b35abc88d876d95792751c /ipecamera
parent01efad2774b55dd956bbbed2ef2b1bdb5a113afd (diff)
downloadpcitool-821a945eafaf63963d56c9bdef773760bea9a41d.tar.gz
pcitool-821a945eafaf63963d56c9bdef773760bea9a41d.tar.bz2
pcitool-821a945eafaf63963d56c9bdef773760bea9a41d.tar.xz
pcitool-821a945eafaf63963d56c9bdef773760bea9a41d.zip
Fix lock-up under the frame-flood, when the frame rate is significantly faster than processing
Diffstat (limited to 'ipecamera')
-rw-r--r--ipecamera/events.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ipecamera/events.c b/ipecamera/events.c
index 58c29a1..3253fc5 100644
--- a/ipecamera/events.c
+++ b/ipecamera/events.c
@@ -139,7 +139,7 @@ int ipecamera_next_event(pcilib_context_t *vctx, pcilib_timeout_t timeout, pcili
}
retry:
- 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;
if (evid) *evid = ctx->reported_id;
@@ -152,9 +152,9 @@ retry:
else
return PCILIB_ERROR_INVALID_ARGUMENT;
}
-
+
if ((ctx->event_id - ctx->reported_id) >= ctx->buffer_size) goto retry;
-
+
return 0;
}