diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2012-10-23 00:52:38 +0200 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2012-10-23 00:52:38 +0200 |
commit | ccbd8b10f96aecfcba91174227fb8b9a78615bfb (patch) | |
tree | 07a2ae5faedca74bc41598e3292acf66a371825a /ipecamera | |
parent | 90895b21b4b87f1f8f5ff8854c0de376f7688146 (diff) | |
download | pcitool-ccbd8b10f96aecfcba91174227fb8b9a78615bfb.tar.gz pcitool-ccbd8b10f96aecfcba91174227fb8b9a78615bfb.tar.bz2 pcitool-ccbd8b10f96aecfcba91174227fb8b9a78615bfb.tar.xz pcitool-ccbd8b10f96aecfcba91174227fb8b9a78615bfb.zip |
Fix re-computation of first processable frame_id
Diffstat (limited to 'ipecamera')
-rw-r--r-- | ipecamera/data.c | 6 | ||||
-rw-r--r-- | ipecamera/events.c | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/ipecamera/data.c b/ipecamera/data.c index ab3f483..10a4954 100644 --- a/ipecamera/data.c +++ b/ipecamera/data.c @@ -87,7 +87,7 @@ static int ipecamera_get_next_buffer_to_process(ipecamera_t *ctx, pcilib_event_i return -1; } - if ((ctx->event_id - ctx->preproc_id) > (ctx->buffer_size - IPECAMERA_RESERVE_BUFFERS)) ctx->preproc_id = ctx->event_id - (ctx->buffer_size - 1) - IPECAMERA_RESERVE_BUFFERS - 1; + if ((ctx->event_id - ctx->preproc_id) > (ctx->buffer_size - IPECAMERA_RESERVE_BUFFERS)) ctx->preproc_id = ctx->event_id - (ctx->buffer_size - 1 - IPECAMERA_RESERVE_BUFFERS - 1); res = ctx->preproc_id%ctx->buffer_size; @@ -123,7 +123,7 @@ void *ipecamera_preproc_thread(void *user) { pthread_rwlock_unlock(&ctx->frame[buf_ptr].mutex); } - + return NULL; } @@ -181,7 +181,7 @@ int ipecamera_get(pcilib_context_t *vctx, pcilib_event_id_t event_id, pcilib_eve pcilib_error("IPECamera imaging is not initialized"); return PCILIB_ERROR_NOTINITIALIZED; } - + buf_ptr = ipecamera_resolve_event_id(ctx, event_id); if (buf_ptr < 0) return PCILIB_ERROR_OVERWRITTEN; 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)); |