From a37beb44d59cca329d0d9345c21505af81030688 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Thu, 9 Apr 2015 14:29:21 +0200 Subject: Check if camera still started if INFINITE timeout is passed to ipecamera_get_next_event --- ipecamera/events.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ipecamera/events.c b/ipecamera/events.c index 8238448..ef85403 100644 --- a/ipecamera/events.c +++ b/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); } -- cgit v1.2.1