From c4f79214e425ae26ec9c27cc0995122321631b87 Mon Sep 17 00:00:00 2001 From: Paul Elder Date: Tue, 28 Aug 2018 02:45:46 -0400 Subject: uvc: reply with max frame rate in response to UVC_GET_MAX Previously, the interval rate that would be selected and replied to the host in response to UVC_GET_MAX, UVC_GET_MIN, and UVC_GET_DEF were all the same and were the first interval rate. Assuming the interval rates are sorted in ascending order, this means that UVC_GET_MAX would always yield the minimum interval rate. Modify the call to uvc_fill_streaming_control such that UVC_GET_MAX will yield the maximum interval rate. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- lib/uvc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/uvc.c b/lib/uvc.c index ab03f0e..975413a 100644 --- a/lib/uvc.c +++ b/lib/uvc.c @@ -8,6 +8,7 @@ */ #include +#include #include #include #include @@ -176,8 +177,10 @@ uvc_events_process_streaming(struct uvc_device *dev, uint8_t req, uint8_t cs, case UVC_GET_MIN: case UVC_GET_MAX: case UVC_GET_DEF: - uvc_fill_streaming_control(dev, ctrl, req == UVC_GET_MAX ? -1 : 1, - req == UVC_GET_MAX ? -1 : 1, 0); + if (req == UVC_GET_MAX) + uvc_fill_streaming_control(dev, ctrl, -1, -1, UINT_MAX); + else + uvc_fill_streaming_control(dev, ctrl, 1, 1, 0); break; case UVC_GET_RES: -- cgit v1.2.3