From 0a979e390ed828a85d26f6b311b4ab14ca681882 Mon Sep 17 00:00:00 2001 From: Tuukka Toivonen Date: Mon, 14 Dec 2015 09:49:57 +0200 Subject: Return proper error code if STREAMON fails Return the error code if video_enable() and VIDIOC_STREAMON fails. Signed-off-by: Tuukka Toivonen Signed-off-by: Laurent Pinchart --- yavta.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'yavta.c') diff --git a/yavta.c b/yavta.c index 09eb485..49361ad 100644 --- a/yavta.c +++ b/yavta.c @@ -1708,7 +1708,9 @@ static int video_do_capture(struct device *dev, unsigned int nframes, } /* Stop streaming. */ - video_enable(dev, 0); + ret = video_enable(dev, 0); + if (ret < 0) + return ret; if (nframes == 0) { printf("No frames captured.\n"); -- cgit v1.2.3