From 41c5995d1a6c23c49e8683095aec7a25361d331a Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Wed, 10 Apr 2013 12:45:12 +0200 Subject: Only break out if duration is set --- tools/grab.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/grab.c b/tools/grab.c index 41f5a6e..972f000 100644 --- a/tools/grab.c +++ b/tools/grab.c @@ -71,7 +71,6 @@ get_bytes_per_pixel (guint bits_per_pixel) return bits_per_pixel > 8 ? 2 : 1; } - #ifdef HAVE_LIBTIFF static void write_tiff (RingBuffer *buffer, @@ -204,7 +203,7 @@ record_frames (UcaCamera *camera, Options *opts) n_frames++; elapsed = g_timer_elapsed (timer, NULL); - if (n_frames == opts->n_frames || elapsed >= opts->duration) + if (n_frames == opts->n_frames || (opts->duration > 0.0 && elapsed >= opts->duration)) break; if (elapsed - last_printed >= 1.0) { -- cgit v1.2.3