summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2013-03-18 21:45:47 +0100
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2013-03-18 21:45:47 +0100
commit01efad2774b55dd956bbbed2ef2b1bdb5a113afd (patch)
treeaa6c7dbae7ed593ac130fd1e0b0e0761a77d36f8
parent21b136f8538df45f2fc0b0ef100a5eaeacf5ac9e (diff)
downloadipecamera-01efad2774b55dd956bbbed2ef2b1bdb5a113afd.tar.gz
ipecamera-01efad2774b55dd956bbbed2ef2b1bdb5a113afd.tar.bz2
ipecamera-01efad2774b55dd956bbbed2ef2b1bdb5a113afd.tar.xz
ipecamera-01efad2774b55dd956bbbed2ef2b1bdb5a113afd.zip
In ipecamera_stop wait until streaming user-thread is terminated
-rw-r--r--ipecamera/ipecamera.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ipecamera/ipecamera.c b/ipecamera/ipecamera.c
index 27bea77..4ba0e9e 100644
--- a/ipecamera/ipecamera.c
+++ b/ipecamera/ipecamera.c
@@ -575,7 +575,11 @@ int ipecamera_stop(pcilib_context_t *vctx, pcilib_event_flags_t flags) {
pcilib_stop_dma(vctx->pcilib, ctx->rdma, PCILIB_DMA_FLAGS_DEFAULT);
ctx->rdma = PCILIB_DMA_ENGINE_INVALID;
}
-
+
+ while (ctx->streaming) {
+ usleep(IPECAMERA_NOFRAME_SLEEP);
+ }
+
if (ctx->ipedec) {
ufo_decoder_free(ctx->ipedec);
ctx->ipedec = NULL;