diff options
author | Sakari Ailus <sakari.ailus@maxwell.research.nokia.com> | 2010-08-06 16:03:35 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2010-08-06 15:15:50 +0200 |
commit | 0a0b2d15b73b68d2e6c8c2d9b1aef2ad61555128 (patch) | |
tree | 8f9077c3db17858d228f5c492a84793461903db6 | |
parent | ec31eb9d2562b6cc2af0d4eee8aeeed4fa2399eb (diff) |
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 <sakari.ailus@maxwell.research.nokia.com>
-rw-r--r-- | yavta.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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) { |