From 2981ee00d97811d50727635ae58a24d955724fe4 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Sat, 8 Nov 2014 02:21:59 +0300 Subject: [PATCH] OpenNI2: prevent failure of setVideoMode() call with invalid parameters Not all parameters are specified for openni::VideoMode, so "selected" mode can be unsupported for device. Replace default VideoMode constructor to result of getVideoMode() call. --- modules/videoio/src/cap_openni2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/videoio/src/cap_openni2.cpp b/modules/videoio/src/cap_openni2.cpp index 62aacb2..8fea1bd 100644 --- a/modules/videoio/src/cap_openni2.cpp +++ b/modules/videoio/src/cap_openni2.cpp @@ -646,7 +646,7 @@ bool CvCapture_OpenNI2::setImageGeneratorProperty(int propIdx, double propValue) { case CV_CAP_PROP_OPENNI_OUTPUT_MODE : { - openni::VideoMode mode; + openni::VideoMode mode = color.getVideoMode(); switch( cvRound(propValue) ) { -- 2.7.4