/alps/ipecamera

To get this branch, use:
bzr branch http://darksoft.org/webbzr/alps/ipecamera

« back to all changes in this revision

Viewing changes to ipecamera/events.c

  • Committer: Suren A. Chilingaryan
  • Date: 2013-03-26 16:32:07 UTC
  • mto: This revision was merged to the branch mainline in revision 204.
  • Revision ID: csa@dside.dyndns.org-20130326163207-xildtskiwnbsubvc
Fix lock-up under the frame-flood, when the frame rate is significantly faster than processing

Show diffs side-by-side

added added

removed removed

Lines of Context:
139
139
    }
140
140
 
141
141
retry:
142
 
    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;
 
142
    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);
143
143
    else ++ctx->reported_id;
144
144
 
145
145
    if (evid) *evid = ctx->reported_id;
152
152
        else
153
153
            return PCILIB_ERROR_INVALID_ARGUMENT;
154
154
    }
155
 
    
 
155
 
156
156
    if ((ctx->event_id - ctx->reported_id) >= ctx->buffer_size) goto retry;
157
 
    
 
157
 
158
158
    return 0;
159
159
}
160
160