From 63c1e2ed60d38e2dd3e2ac4688c05644e7701667 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Mon, 19 Apr 2021 11:14:00 +0100 Subject: [PATCH] v4l2src: fix spurious SOURCE_CHANGED error-level log messages They're harmless, and some drivers at least return EINVAL instead of ENOTTY for unsupported events (here: uvcvideo). Part-of: --- sys/v4l2/v4l2_calls.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/v4l2/v4l2_calls.c b/sys/v4l2/v4l2_calls.c index b6b51af..299eab0 100644 --- a/sys/v4l2/v4l2_calls.c +++ b/sys/v4l2/v4l2_calls.c @@ -1257,10 +1257,15 @@ gst_v4l2_subscribe_event (GstV4l2Object * v4l2object, guint32 event, guint32 id) /* ERRORS */ failed: { - if (errno != ENOTTY) + if (errno == ENOTTY || errno == EINVAL) { + GST_DEBUG_OBJECT (v4l2object->dbg_obj, + "Cannot subscribe to '%s' event: %s", + gst_v4l2_event_to_string (event), "not supported"); + } else { GST_ERROR_OBJECT (v4l2object->dbg_obj, "Cannot subscribe to '%s' event: %s", gst_v4l2_event_to_string (event), g_strerror (errno)); + } return FALSE; } } -- 2.7.4