Commit fbcf5f09 authored by Alexander Duda's avatar Alexander Duda

cvCreateCameraCapture: fix using preffered interface

The provided interface id must be removed from the index. Otherwise, the
underlying implementations are using a wrong camera id.

Example:
VideoCapture(800) fails because PvAPI tries to open a camera
on position 800
parent 68f8d1ce
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment