From 62e32042aee4042b6a931bc27a6ad11384b521f5 Mon Sep 17 00:00:00 2001 From: Umang Jain Date: Thu, 30 Jun 2022 12:04:43 +0530 Subject: gstreamer: Be pedantic on srcpads access Use the std::vector::back() instead of [0] index which corresponds to std::vector::push_back() for tracking of pads. This doesn't introduce a functional change as the gst_libcamera_src_init() will only add one pad but it helps with readability. Signed-off-by: Umang Jain Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/gstreamer/gstlibcamerasrc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp index 3d3efc0c..16d70fea 100644 --- a/src/gstreamer/gstlibcamerasrc.cpp +++ b/src/gstreamer/gstlibcamerasrc.cpp @@ -746,7 +746,7 @@ gst_libcamera_src_init(GstLibcameraSrc *self) gst_task_set_lock(self->task, &self->stream_lock); state->srcpads_.push_back(gst_pad_new_from_template(templ, "src")); - gst_element_add_pad(GST_ELEMENT(self), state->srcpads_[0]); + gst_element_add_pad(GST_ELEMENT(self), state->srcpads_.back()); /* C-style friend. */ state->src_ = self; -- cgit v1.2.1