diff options
| author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2010-11-26 16:19:34 +0100 | 
|---|---|---|
| committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2010-11-26 16:19:34 +0100 | 
| commit | b3b77c9c434aa690bab8c2e598ecfe28b18d02e6 (patch) | |
| tree | b67ce698a927861ecd09d446a6bf7066b24e2e94 /yavta.c | |
| parent | 7787c8ef296807cd11e853cea7b0b92d9f9b3623 (diff) | |
Fix uninitialized variable warning in video_do_capture()
Make sure the variable won't be use uninitialized and silent the
warning.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'yavta.c')
| -rw-r--r-- | yavta.c | 8 | 
1 files changed, 7 insertions, 1 deletions
@@ -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;  | 
