From 76b40a37e737ed822c75fc95749e4f33723e2be9 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Thu, 8 Aug 2019 14:56:49 +0100 Subject: [PATCH] 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 --- modules/videoio/src/cap_v4l.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/videoio/src/cap_v4l.cpp b/modules/videoio/src/cap_v4l.cpp index 8035d456b5..645aa67e40 100644 --- a/modules/videoio/src/cap_v4l.cpp +++ b/modules/videoio/src/cap_v4l.cpp @@ -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; }