This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/v4l-utils.git tree:

Subject: v4l2-ctl: fix sliced vbi mode parsing
Author:  Hans Verkuil <[email protected]>
Date:    Mon Oct 27 11:05:36 2014 +0100

--set-fmt-sliced-vbi=cc didn't work, you had to do --set-fmt-sliced-vbi=cc=1.
This has now been fixed.

Signed-off-by: Hans Verkuil <[email protected]>
(cherry picked from commit 6cc971e98bc4aa5444db301781e0d72bde07b27d)

 utils/v4l2-ctl/v4l2-ctl-vbi.cpp |   40 ++++++++++++++++----------------------
 1 files changed, 17 insertions(+), 23 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=fc0e03a09c63ad9584f45fa9793796458bcad801

diff --git a/utils/v4l2-ctl/v4l2-ctl-vbi.cpp b/utils/v4l2-ctl/v4l2-ctl-vbi.cpp
index 3b6b557..8b59c33 100644
--- a/utils/v4l2-ctl/v4l2-ctl-vbi.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-vbi.cpp
@@ -91,41 +91,35 @@ void vbi_cmd(int ch, char *optarg)
        case OptSetSlicedVbiFormat:
        case OptTrySlicedVbiFormat:
                fmt->fmt.sliced.service_set = 0;
-               subs = optarg;
-               while (*subs != '\0') {
-                       static const char *const subopts[] = {
-                               "off",
-                               "teletext",
-                               "cc",
-                               "wss",
-                               "vps",
-                               NULL
-                       };
+               if (optarg[0] == 0) {
+                       fprintf(stderr, "empty string\n");
+                       vbi_usage();
+                       exit(1);
+               }
+               while (*optarg) {
+                       subs = strchr(optarg, ',');
+                       if (subs)
+                               *subs = 0;
 
-                       switch (parse_subopt(&subs, subopts, &value)) {
-                       case 0:
+                       if (!strcmp(optarg, "off"))
                                found_off = true;
-                               break;
-                       case 1:
+                       else if (!strcmp(optarg, "teletext"))
                                fmt->fmt.sliced.service_set |=
                                        V4L2_SLICED_TELETEXT_B;
-                               break;
-                       case 2:
+                       else if (!strcmp(optarg, "cc"))
                                fmt->fmt.sliced.service_set |=
                                        V4L2_SLICED_CAPTION_525;
-                               break;
-                       case 3:
+                       else if (!strcmp(optarg, "wss"))
                                fmt->fmt.sliced.service_set |=
                                        V4L2_SLICED_WSS_625;
-                               break;
-                       case 4:
+                       else if (!strcmp(optarg, "vps"))
                                fmt->fmt.sliced.service_set |=
                                        V4L2_SLICED_VPS;
-                               break;
-                       default:
+                       else
                                vbi_usage();
+                       if (subs == NULL)
                                break;
-                       }
+                       optarg = subs + 1;
                }
                if (found_off && fmt->fmt.sliced.service_set) {
                        fprintf(stderr, "Sliced VBI mode 'off' cannot be 
combined with other modes\n");

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to