summaryrefslogtreecommitdiffstats
path: root/src/gsttools/qgstappsrc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gsttools/qgstappsrc.cpp')
-rw-r--r--src/gsttools/qgstappsrc.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gsttools/qgstappsrc.cpp b/src/gsttools/qgstappsrc.cpp
index 8917bda85..2c9f64c34 100644
--- a/src/gsttools/qgstappsrc.cpp
+++ b/src/gsttools/qgstappsrc.cpp
@@ -72,7 +72,11 @@ bool QGstAppSrc::setup(GstElement* appsrc)
if (m_setup || m_stream == 0 || appsrc == 0)
return false;
+ if (m_appSrc)
+ gst_object_unref(G_OBJECT(m_appSrc));
+
m_appSrc = GST_APP_SRC(appsrc);
+ gst_object_ref(G_OBJECT(m_appSrc));
gst_app_src_set_callbacks(m_appSrc, (GstAppSrcCallbacks*)&m_callbacks, this, (GDestroyNotify)&QGstAppSrc::destroy_notify);
g_object_get(G_OBJECT(m_appSrc), "max-bytes", &m_maxBytes, NULL);