diff options
author | Marcus Glocker <mglocker@cvs.openbsd.org> | 2008-07-24 13:30:11 +0000 |
---|---|---|
committer | Marcus Glocker <mglocker@cvs.openbsd.org> | 2008-07-24 13:30:11 +0000 |
commit | 21bb1766daf8306471629761a5f291a9a73e4c8e (patch) | |
tree | 6da2ae9dd3d0ff0698b708ad5c7f1c639cdcc63c | |
parent | 36c25f0ff4f97aef383e08f9878384142c576154 (diff) |
Simplify uvideo_enum_fmt(), no functional changes.
-rw-r--r-- | sys/dev/usb/uvideo.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c index 0ec281dac79..7081958565b 100644 --- a/sys/dev/usb/uvideo.c +++ b/sys/dev/usb/uvideo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvideo.c,v 1.60 2008/07/23 14:10:58 mglocker Exp $ */ +/* $OpenBSD: uvideo.c,v 1.61 2008/07/24 13:30:10 mglocker Exp $ */ /* * Copyright (c) 2008 Robert Nagy <robert@openbsd.org> @@ -2098,7 +2098,7 @@ uvideo_enum_fmt(void *v, struct v4l2_fmtdesc *fmtdesc) return (EINVAL); idx = fmtdesc->index + 1; - if (idx == UVIDEO_MAX_FORMAT || sc->sc_fmtgrp[idx].format == NULL) + if (idx > sc->sc_fmtgrp_num) /* no more formats left */ return (EINVAL); @@ -2112,13 +2112,13 @@ uvideo_enum_fmt(void *v, struct v4l2_fmtdesc *fmtdesc) break; case UDESCSUB_VS_FORMAT_UNCOMPRESSED: fmtdesc->flags = 0; - if (!strcmp(sc->sc_fmtgrp[idx].format->u.uc.guidFormat, - "YUY2")) { + if (sc->sc_fmtgrp[idx].pixelformat == + V4L2_PIX_FMT_YUYV) { (void)strlcpy(fmtdesc->description, "YUYV", sizeof(fmtdesc->description)); fmtdesc->pixelformat = V4L2_PIX_FMT_YUYV; - } else if (!strcmp(sc->sc_fmtgrp[idx].format->u.uc.guidFormat, - "NV12")) { + } else if (sc->sc_fmtgrp[idx].pixelformat == + V4L2_PIX_FMT_NV12) { (void)strlcpy(fmtdesc->description, "NV12", sizeof(fmtdesc->description)); fmtdesc->pixelformat = V4L2_PIX_FMT_NV12; |