qv4l2: fix a confusing error message when capturing VBI.
authorHans Verkuil <hans.verkuil@cisco.com>
Tue, 15 Jul 2014 09:41:42 +0000 (11:41 +0200)
committerHans Verkuil <hans.verkuil@cisco.com>
Tue, 15 Jul 2014 09:41:42 +0000 (11:41 +0200)
The message says "non-grey pixelformat not supported for VBI", but what
it really should say is: "this input does not support VBI".

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
utils/qv4l2/qv4l2.cpp

index 02b56c4..886b03f 100644 (file)
@@ -1098,7 +1098,14 @@ void ApplicationWindow::capStart(bool start)
                v4l2_format fmt;
                v4l2_std_id std;
 
-               g_fmt_vbi(fmt);
+               if (!g_std(std)) {
+                       error("this input isn't suitable for VBI\n");
+                       return;
+               }
+               if (!g_fmt_vbi(fmt)) {
+                       error("could not obtain a VBI format\n");
+                       return;
+               }
                if (fmt.fmt.vbi.sample_format != V4L2_PIX_FMT_GREY) {
                        error("non-grey pixelformat not supported for VBI\n");
                        return;