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.
This commit is contained in:
Filippo Argiolas 2009-08-14 10:11:25 +02:00
parent 352e071660
commit a3a61f8940
2 changed files with 9 additions and 0 deletions

View file

@ -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;
}

View file

@ -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;