summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorFilippo Argiolas <filippo.argiolas@gmail.com>2009-08-14 10:11:25 +0200
committerFilippo Argiolas <filippo.argiolas@gmail.com>2009-08-14 10:15:43 +0200
commita3a61f89403cd39fd08f2f1d0e1475f55b0a48f4 (patch)
tree0f5a6ffb30163abbd84dd8f2afae01213540afd8 /sys
parent352e07166070e4815332502f328d81f738fff244 (diff)
v4l2src: clear format list in READY->NULL
Clear format list and probed caps when going to NULL so if a new device is set we'll probe the formats again instead of using previously detected ones. Fixes bug #591747.
Diffstat (limited to 'sys')
-rw-r--r--sys/v4l2/gstv4l2object.c4
-rw-r--r--sys/v4l2/gstv4l2src.c5
2 files changed, 9 insertions, 0 deletions
diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c
index ce6f7c9a..f73ce218 100644
--- a/sys/v4l2/gstv4l2object.c
+++ b/sys/v4l2/gstv4l2object.c
@@ -604,6 +604,10 @@ gst_v4l2_object_stop (GstV4l2Object * v4l2object)
if (!gst_v4l2_close (v4l2object))
return FALSE;
+ if (v4l2object->formats) {
+ gst_v4l2_object_clear_format_list (v4l2object);
+ }
+
return TRUE;
}
diff --git a/sys/v4l2/gstv4l2src.c b/sys/v4l2/gstv4l2src.c
index f0400518..2f0fef9e 100644
--- a/sys/v4l2/gstv4l2src.c
+++ b/sys/v4l2/gstv4l2src.c
@@ -760,6 +760,11 @@ gst_v4l2src_change_state (GstElement * element, GstStateChange transition)
/* close the device */
if (!gst_v4l2_object_stop (v4l2src->v4l2object))
return GST_STATE_CHANGE_FAILURE;
+
+ if (v4l2src->probed_caps) {
+ gst_caps_unref (v4l2src->probed_caps);
+ v4l2src->probed_caps = NULL;
+ }
break;
default:
break;