Browse Source

Check if camera still started if INFINITE timeout is passed to ipecamera_get_next_event

Suren A. Chilingaryan 9 years ago
parent
commit
a37beb44d5
1 changed files with 2 additions and 2 deletions
  1. 2 2
      ipecamera/events.c

+ 2 - 2
ipecamera/events.c

@@ -113,9 +113,9 @@ int ipecamera_next_event(pcilib_context_t *vctx, pcilib_timeout_t timeout, pcili
 	if (timeout) {
 	    if (timeout == PCILIB_TIMEOUT_INFINITE) {
 #ifdef IPECAMERA_ANNOUNCE_READY
-		while ((((!ctx->preproc)&&(ctx->reported_id == ctx->event_id))||((ctx->preproc)&&(ctx->reported_id == ctx->preproc_id)))) {
+		while ((ctx->started)&&(((!ctx->preproc)&&(ctx->reported_id == ctx->event_id))||((ctx->preproc)&&(ctx->reported_id == ctx->preproc_id)))) {
 #else /* IPECAMERA_ANNOUNCE_READY */
-		while ((ctx->reported_id == ctx->event_id)) {
+		while ((ctx->started)&&(ctx->reported_id == ctx->event_id)) {
 #endif /* IPECAMERA_ANNOUNCE_READY */
 		usleep(IPECAMERA_NOFRAME_SLEEP);
 		}