From 782d44b81b62271929844c6fd939edd940222983 Mon Sep 17 00:00:00 2001 From: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com> Date: Wed, 28 Aug 2019 22:20:49 +0200 Subject: [PATCH] [Bugfix] V4L2 used screen resolution for fallback https://hyperion-project.org/threads/ng-hyperion-v4l2-capture-resolution-issue.3684/#post-15959 --- libsrc/grabber/v4l2/V4L2Grabber.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/libsrc/grabber/v4l2/V4L2Grabber.cpp b/libsrc/grabber/v4l2/V4L2Grabber.cpp index ae6047f1..43db07c3 100644 --- a/libsrc/grabber/v4l2/V4L2Grabber.cpp +++ b/libsrc/grabber/v4l2/V4L2Grabber.cpp @@ -617,8 +617,16 @@ void V4L2Grabber::init_device(VideoStandard videoStandard, int input) } // set the settings - fmt.fmt.pix.width = max_width; - fmt.fmt.pix.height = max_height; + if (max_width != 0 || max_height != 0) + { + fmt.fmt.pix.width = max_width; + fmt.fmt.pix.height = max_height; + } + else + { + fmt.fmt.pix.width = _width; + fmt.fmt.pix.height = _height; + } if (-1 == xioctl(VIDIOC_S_FMT, &fmt)) {