Merge pull request #15111 from RealOrangeOne:patch-1

* Remove unavoidable print of CV error

The return value covers whether the device exists.

This might be better hidden behind a debug flag, but I couldn't work out how to do that nicely.

* Use `CV_LOG_WARNING` macro to log rather than removing it entirely
This commit is contained in:
Jake Howard 2019-08-08 14:56:49 +01:00 committed by Alexander Alekhin
parent 32da0705cf
commit 76b40a37e7

View File

@ -792,11 +792,10 @@ bool CvCaptureCAM_V4L::open(int _index)
name = cv::format("/dev/video%d", _index);
}
/* Print the CameraNumber at the end of the string with a width of one character */
bool res = open(name.c_str());
if (!res)
{
fprintf(stderr, "VIDEOIO ERROR: V4L: can't open camera by index %d\n", _index);
CV_LOG_WARNING(NULL, cv::format("VIDEOIO ERROR: V4L: can't open camera by index %d", _index));
}
return res;
}