summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2015-04-09 14:29:21 +0200
committerSuren A. Chilingaryan <csa@suren.me>2015-04-09 14:29:21 +0200
commita37beb44d59cca329d0d9345c21505af81030688 (patch)
treee290cbfc22c061e193a2f88a7ea9b1b2124df76a
parenta1d746f850c487c065e518052f5205812a1f4adf (diff)
downloadipecamera-a37beb44d59cca329d0d9345c21505af81030688.tar.gz
ipecamera-a37beb44d59cca329d0d9345c21505af81030688.tar.bz2
ipecamera-a37beb44d59cca329d0d9345c21505af81030688.tar.xz
ipecamera-a37beb44d59cca329d0d9345c21505af81030688.zip
Check if camera still started if INFINITE timeout is passed to ipecamera_get_next_event
-rw-r--r--ipecamera/events.c4
1 files 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);
}