summaryrefslogtreecommitdiff
path: root/yavta.c
diff options
context:
space:
mode:
Diffstat (limited to 'yavta.c')
-rw-r--r--yavta.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/yavta.c b/yavta.c
index 57dfa8c..f272a64 100644
--- a/yavta.c
+++ b/yavta.c
@@ -806,7 +806,8 @@ static int video_do_capture(struct device *dev, unsigned int nframes,
int do_requeue_last)
{
char *filename = NULL;
- struct timeval start, end, ts;
+ struct timeval start = { 0, 0 };
+ struct timeval end, ts;
struct v4l2_buffer buf;
unsigned int size;
unsigned int i;
@@ -891,6 +892,11 @@ static int video_do_capture(struct device *dev, unsigned int nframes,
/* Stop streaming. */
video_enable(dev, 0);
+ if (nframes == 0) {
+ printf("No frames captured.\n");
+ goto done;
+ }
+
if (end.tv_sec == start.tv_sec && end.tv_usec == start.tv_usec)
goto done;