/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: 2012-07-27 11:54:32 UTC
  • Revision ID: csa@dside.dyndns.org-20120727115432-ls8vhghh9ox9aa0z
Bail out from ipecamera_get_next_event if camera is stopped during the wait

Show diffs side-by-side

added added

removed removed

Lines of Context:
123
123
                pcilib_calc_deadline(&tv, timeout);
124
124
 
125
125
#ifdef IPECAMERA_ANNOUNCE_READY
126
 
                while ((pcilib_calc_time_to_deadline(&tv) > 0)&&(((!ctx->preproc)&&(ctx->reported_id == ctx->event_id))||((ctx->preproc)&&(ctx->reported_id == ctx->preproc_id)))) {
 
126
                while ((ctx->started)&&(pcilib_calc_time_to_deadline(&tv) > 0)&&(((!ctx->preproc)&&(ctx->reported_id == ctx->event_id))||((ctx->preproc)&&(ctx->reported_id == ctx->preproc_id)))) {
127
127
#else /* IPECAMERA_ANNOUNCE_READY */
128
 
                while ((pcilib_calc_time_to_deadline(&tv) > 0)&&(ctx->reported_id == ctx->event_id)) {
 
128
                while ((ctx->started)&&(pcilib_calc_time_to_deadline(&tv) > 0)&&(ctx->reported_id == ctx->event_id)) {
129
129
#endif /* IPECAMERA_ANNOUNCE_READY */
130
 
                usleep(IPECAMERA_NOFRAME_SLEEP);
 
130
                    usleep(IPECAMERA_NOFRAME_SLEEP);
131
131
                }
132
132
            }
133
 
            
134
133
        }
135
134
        
136
 
        if (ctx->reported_id == ctx->event_id) return PCILIB_ERROR_TIMEOUT;
 
135
        if (ctx->reported_id == ctx->event_id) {
 
136
            return PCILIB_ERROR_TIMEOUT;
 
137
        }
137
138
        
138
139
    }
139
140