From 0a0b2d15b73b68d2e6c8c2d9b1aef2ad61555128 Mon Sep 17 00:00:00 2001 From: Sakari Ailus Date: Fri, 6 Aug 2010 16:03:35 +0300 Subject: Do not divide by zero. If only one buffer was processed the performance measurement calculation caused a division by zero. Do not do show measurements if they are bad. Signed-off-by: Sakari Ailus --- yavta.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'yavta.c') diff --git a/yavta.c b/yavta.c index 1b9a7ff..f8dfed6 100644 --- a/yavta.c +++ b/yavta.c @@ -882,6 +882,9 @@ static int video_do_capture(struct device *dev, unsigned int nframes, /* Stop streaming. */ video_enable(dev, 0); + if (end.tv_sec == start.tv_sec && end.tv_usec == start.tv_usec) + goto done; + end.tv_sec -= start.tv_sec; end.tv_usec -= start.tv_usec; if (end.tv_usec < 0) { -- cgit v1.2.3