summaryrefslogtreecommitdiffstats
path: root/src/plugins/gstreamer
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/gstreamer')
-rw-r--r--src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodersession.cpp1
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinsession.cpp15
2 files changed, 12 insertions, 4 deletions
diff --git a/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodersession.cpp b/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodersession.cpp
index 779978e70..d6b8ad759 100644
--- a/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodersession.cpp
+++ b/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodersession.cpp
@@ -478,6 +478,7 @@ QAudioBuffer QGstreamerAudioDecoderSession::read()
}
}
#if GST_CHECK_VERSION(1,0,0)
+ gst_buffer_unmap(buffer, &mapInfo);
gst_sample_unref(sample);
#else
gst_buffer_unref(buffer);
diff --git a/src/plugins/gstreamer/camerabin/camerabinsession.cpp b/src/plugins/gstreamer/camerabin/camerabinsession.cpp
index ab0bea24a..4941c6ef6 100644
--- a/src/plugins/gstreamer/camerabin/camerabinsession.cpp
+++ b/src/plugins/gstreamer/camerabin/camerabinsession.cpp
@@ -212,6 +212,12 @@ CameraBinSession::~CameraBinSession()
if (m_sourceFactory)
gst_object_unref(GST_OBJECT(m_sourceFactory));
+
+ if (m_cameraSrc)
+ gst_object_unref(GST_OBJECT(m_cameraSrc));
+
+ if (m_videoSrc)
+ gst_object_unref(GST_OBJECT(m_videoSrc));
}
#if QT_CONFIG(gstreamer_photography)
@@ -538,11 +544,12 @@ GstElement *CameraBinSession::buildCameraSource()
}
}
- if (m_cameraSrc != camSrc)
+ if (m_cameraSrc != camSrc) {
g_object_set(G_OBJECT(m_camerabin), CAMERA_SOURCE_PROPERTY, m_cameraSrc, NULL);
-
- if (camSrc)
- gst_object_unref(GST_OBJECT(camSrc));
+ // Unref only if camSrc is not m_cameraSrc to prevent double unrefing.
+ if (camSrc)
+ gst_object_unref(GST_OBJECT(camSrc));
+ }
return m_cameraSrc;
}