From f164f954acfe1171b7b0b3e87dca5e27f5857419 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Tue, 23 Oct 2012 02:38:08 +0200 Subject: More fixes to frame separation in multiframe mode; debugging mode --- ipecamera/ipecamera.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'ipecamera/ipecamera.c') diff --git a/ipecamera/ipecamera.c b/ipecamera/ipecamera.c index d1a9102..2868d6b 100644 --- a/ipecamera/ipecamera.c +++ b/ipecamera/ipecamera.c @@ -126,6 +126,14 @@ pcilib_context_t *ipecamera_init(pcilib_t *pcilib) { pcilib_error("Unsupported version of firmware (%lu)", value); } +#ifdef IPECAMERA_BUG_POSTPONED_READ + GET_REG(max_frames_reg, value); + if (value >= ctx->buffer_size) { + ctx->buffer_size = value + 1; + } +#endif /* IPECAMERA_BUG_POSTPONED_READ */ + + ctx->rdma = PCILIB_DMA_ENGINE_INVALID; ctx->wdma = PCILIB_DMA_ENGINE_INVALID; @@ -408,14 +416,14 @@ int ipecamera_start(pcilib_context_t *vctx, pcilib_event_t event_mask, pcilib_ev } // Clean DMA -/* +#ifndef IPECAMERA_BUG_POSTPONED_READ err = pcilib_skip_dma(vctx->pcilib, ctx->rdma); if (err) { ipecamera_stop(vctx, PCILIB_EVENT_FLAGS_DEFAULT); pcilib_error("Can't start grabbing, device continuously writes unexpected data using DMA engine"); return err; } -*/ +#endif /* ! IPECAMERA_BUG_POSTPONED_READ */ if (vctx->params.autostop.duration) { gettimeofday(&ctx->autostop.timestamp, NULL); -- cgit v1.2.3