From 3f360e8f151e01e6f4389c6487786cf16e9d15c1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?I=C3=B1igo=20Huguet?= Date: Thu, 2 Aug 2018 08:40:17 +0200 Subject: [PATCH] v4l2src: fix first input used is always used next times The input from an v4l2 device that was used the first time was remembered for next times, and set again always the pipeline is set to READY state. This was making that users wasn't able to select a different input without having to create a new pipeline. This patch makes that v4l2src element forget previous used input when going to NULL state, so it will check again for the current selected input when going again to READY state. Users can change to NULL state, select a new input with a VIDIOC_S_INPUT ioctl and change to PLAYING again. https://bugzilla.gnome.org/show_bug.cgi?id=796908 --- sys/v4l2/gstv4l2object.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c index 11c81ff..c6e74b0 100644 --- a/sys/v4l2/gstv4l2object.c +++ b/sys/v4l2/gstv4l2object.c @@ -926,6 +926,11 @@ gst_v4l2_object_close (GstV4l2Object * v4l2object) g_free (v4l2object->par); v4l2object->par = NULL; } + + if (v4l2object->channel) { + g_free (v4l2object->channel); + v4l2object->channel = NULL; + } return TRUE; } -- 2.7.4