dmabuftest: Return from thread if streamon fails
authorNikhil Devshatwar <nikhil.nd@ti.com>
Fri, 26 Sep 2014 09:58:47 +0000 (15:28 +0530)
committerNikhil Devshatwar <nikhil.nd@ti.com>
Wed, 1 Oct 2014 08:38:31 +0000 (14:08 +0530)
Currently failed streamon is ignored and the app tries to perform
QBUF and DQBUF ioctls flooding the output with errors.

This can be avoided if the thread exits gracefully with an error.

Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
dmabuftest.c

index ab6e1d67098759ad030743a20094ddcccf742fa6..0dbb32ad702cfb1f2b49f1b51b5d55394e14ba6d 100644 (file)
@@ -71,7 +71,11 @@ capture_loop(void *arg)
                v4l2_qbuf(v4l2, buffers[i]);
        }
 
-       v4l2_streamon(v4l2);
+       ret = v4l2_streamon(v4l2);
+       if (ret) {
+               return NULL;
+       }
+
        for (i = 1; i < CNT; i++) {
 
                capt = v4l2_dqbuf(v4l2);