diff --git a/modules/videoio/src/cap.cpp b/modules/videoio/src/cap.cpp index d2da6edfe7..2447431cbb 100644 --- a/modules/videoio/src/cap.cpp +++ b/modules/videoio/src/cap.cpp @@ -129,6 +129,9 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index) // interpret preferred interface (0 = autodetect) int pref = (index / 100) * 100; + // remove pref from index + index -= pref; + // local variable to memorize the captured device CvCapture *capture = 0;