From 73a909c0e301c0282da34b456ae6c705c0b53092 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Mon, 20 Sep 2010 08:42:41 -0300 Subject: [PATCH] camerabin: cleanup used caps when going to NULL Resets used caps so that camerabin doesn't try to use them when restarting, where elements/properties might have changed and the old caps be incompatible --- gst/camerabin/gstcamerabin.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gst/camerabin/gstcamerabin.c b/gst/camerabin/gstcamerabin.c index 375987cda4..713a18de78 100644 --- a/gst/camerabin/gstcamerabin.c +++ b/gst/camerabin/gstcamerabin.c @@ -851,6 +851,15 @@ camerabin_destroy_elements (GstCameraBin * camera) camera->active_bin = NULL; + /* Reset caps data as the elements might be completely different next + * time we 'start' */ + if (camera->view_finder_caps) { + gst_caps_replace (&camera->view_finder_caps, NULL); + } + gst_caps_replace (&camera->allowed_caps, NULL); + camera->fps_n = camera->fps_d = 0; + camera->width = camera->height = 0; + /* Remove elements */ gst_camerabin_remove_elements_from_bin (GST_BIN (camera)); }