diff options
Diffstat (limited to 'v4l2-apps/util/v4l2-ctl.cpp')
-rw-r--r-- | v4l2-apps/util/v4l2-ctl.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/v4l2-apps/util/v4l2-ctl.cpp b/v4l2-apps/util/v4l2-ctl.cpp index d637e34d7..57d98fc13 100644 --- a/v4l2-apps/util/v4l2-ctl.cpp +++ b/v4l2-apps/util/v4l2-ctl.cpp @@ -485,10 +485,16 @@ static void print_sliced_vbi_cap(struct v4l2_sliced_vbi_cap &cap) static std::string name2var(unsigned char *name) { std::string s; + int add_underscore = 0; while (*name) { - if (*name == ' ') s += "_"; - else s += std::string(1, tolower(*name)); + if (isalnum(*name)) { + if (add_underscore) + s += '_'; + add_underscore = 0; + s += std::string(1, tolower(*name)); + } + else if (s.length()) add_underscore = 1; name++; } return s; @@ -1365,7 +1371,7 @@ int main(int argc, char **argv) std = V4L2_STD_SECAM; } else { - std = strtol(optarg, 0L, 0); + std = strtol(optarg, 0L, 0) | (1ULL << 63); } break; case OptGetCtrl: @@ -1562,8 +1568,8 @@ int main(int argc, char **argv) } if (options[OptSetStandard]) { - if (std < 16) { - vs.index = std; + if (std & (1ULL << 63)) { + vs.index = std & 0xffff; if (ioctl(fd, VIDIOC_ENUMSTD, &vs) >= 0) { std = vs.id; } |