diff options
author | Thiago Santos <thiagoss@osg.samsung.com> | 2015-03-14 11:45:20 +0000 |
---|---|---|
committer | Thiago Santos <thiagoss@osg.samsung.com> | 2015-03-14 18:29:28 +0000 |
commit | 5c20c2e2113ed8d11e829f5744284ff647d48aa0 (patch) | |
tree | c190d6ea6a3c0d624aa11f8e18dd9d15772b4fd4 /gst/camerabin2 | |
parent | 199f9bd194ec4c367b5c8aafa95f8336539e6955 (diff) | |
download | gstreamer-plugins-bad-5c20c2e2113ed8d11e829f5744284ff647d48aa0.tar.gz |
wrappercamerabinsrc: fix pad leak
Only get the pad if it is really going to be used to avoid
leaking it
Diffstat (limited to 'gst/camerabin2')
-rw-r--r-- | gst/camerabin2/gstwrappercamerabinsrc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gst/camerabin2/gstwrappercamerabinsrc.c b/gst/camerabin2/gstwrappercamerabinsrc.c index b1335e223..25643f322 100644 --- a/gst/camerabin2/gstwrappercamerabinsrc.c +++ b/gst/camerabin2/gstwrappercamerabinsrc.c @@ -852,17 +852,17 @@ start_image_capture (GstWrapperCameraBinSrc * self) GST_TYPE_PHOTOGRAPHY); gboolean ret = FALSE; GstCaps *caps; - GstPad *pad, *peer; GST_DEBUG_OBJECT (self, "Starting image capture"); /* V4L2 source will not close the device until all buffers have came * back. Draining the pipeline, will ensure it's properly closed, and that * setting it back to PLAYING will work. */ - pad = gst_element_get_static_pad (self->src_vid_src, "src"); if (self->image_renegotiate) { + GstPad *pad, *peer; g_mutex_unlock (&bcamsrc->capturing_mutex); + pad = gst_element_get_static_pad (self->src_vid_src, "src"); peer = gst_pad_get_peer (pad); gst_object_unref (pad); gst_pad_query (peer, gst_query_new_drain ()); |