mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 06:58:56 +00:00
wrappercamerabinsrc: fix pad leak
Only get the pad if it is really going to be used to avoid leaking it
This commit is contained in:
parent
199f9bd194
commit
5c20c2e211
1 changed files with 2 additions and 2 deletions
|
@ -852,17 +852,17 @@ start_image_capture (GstWrapperCameraBinSrc * self)
|
||||||
GST_TYPE_PHOTOGRAPHY);
|
GST_TYPE_PHOTOGRAPHY);
|
||||||
gboolean ret = FALSE;
|
gboolean ret = FALSE;
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
GstPad *pad, *peer;
|
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (self, "Starting image capture");
|
GST_DEBUG_OBJECT (self, "Starting image capture");
|
||||||
|
|
||||||
/* V4L2 source will not close the device until all buffers have came
|
/* V4L2 source will not close the device until all buffers have came
|
||||||
* back. Draining the pipeline, will ensure it's properly closed, and that
|
* back. Draining the pipeline, will ensure it's properly closed, and that
|
||||||
* setting it back to PLAYING will work. */
|
* setting it back to PLAYING will work. */
|
||||||
pad = gst_element_get_static_pad (self->src_vid_src, "src");
|
|
||||||
if (self->image_renegotiate) {
|
if (self->image_renegotiate) {
|
||||||
|
GstPad *pad, *peer;
|
||||||
|
|
||||||
g_mutex_unlock (&bcamsrc->capturing_mutex);
|
g_mutex_unlock (&bcamsrc->capturing_mutex);
|
||||||
|
pad = gst_element_get_static_pad (self->src_vid_src, "src");
|
||||||
peer = gst_pad_get_peer (pad);
|
peer = gst_pad_get_peer (pad);
|
||||||
gst_object_unref (pad);
|
gst_object_unref (pad);
|
||||||
gst_pad_query (peer, gst_query_new_drain ());
|
gst_pad_query (peer, gst_query_new_drain ());
|
||||||
|
|
Loading…
Reference in a new issue