Search
SailfishOS Open Build Service
>
Projects
>
home:plfiorini
:
maui:devel
:
armv6l
>
gst-plugins-bad-free
> _service:tar_git:0021-camerabin-Fix-leaked-caps-reference-in-preview_notif.patch
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File _service:tar_git:0021-camerabin-Fix-leaked-caps-reference-in-preview_notif.patch of Package gst-plugins-bad-free
From 50e0a18d292dbf90a75a8e90f9601f01af11217e Mon Sep 17 00:00:00 2001 From: Lasse Laukkanen <ext-lasse.2.laukkanen@nokia.com> Date: Wed, 27 Oct 2010 17:28:46 +0300 Subject: [PATCH 21/23] camerabin: Fix leaked caps reference in preview_notify_cb() --- gst/camerabin/gstcamerabin.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/gst/camerabin/gstcamerabin.c b/gst/camerabin/gstcamerabin.c index 9ead721..f6dad99 100644 --- a/gst/camerabin/gstcamerabin.c +++ b/gst/camerabin/gstcamerabin.c @@ -2909,9 +2909,16 @@ gst_camerabin_preview_notify_cb (GObject * video_source, GParamSpec * pspec, gpointer user_data) { GstCameraBin *camera = GST_CAMERABIN (user_data); - if (gst_photography_get_format (GST_PHOTOGRAPHY (camera->src_vid_src), - GST_PHOTOGRAPHY_OPERATION_MODE_PREVIEW) == NULL - && camera->preview_caps) { + GstCaps *source_preview_caps = NULL; + + source_preview_caps = + gst_photography_get_format (GST_PHOTOGRAPHY (camera->src_vid_src), + GST_PHOTOGRAPHY_OPERATION_MODE_PREVIEW); + + if (source_preview_caps != NULL) { + /* Preview caps has been set to video source ok */ + gst_caps_unref (source_preview_caps); + } else if (camera->preview_caps) { /* Preview caps have been set to camerabin, but they are not in effect in video source. This may happen if preview caps were previously set while video source was in NULL state or video source has reset them. */ -- 1.7.10.4