summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2016-04-27 09:21:31 +0300
committerSebastian Dröge <sebastian@centricular.com>2016-04-27 09:22:27 +0300
commita4db38ab0578e598abf466a53dc6965c91e7a32e (patch)
treea945bf1ea2e5796818c0c92c19a008e6e8c8c8c4
parent8daad351a46e6e049fd7f0d8acd2f4b986a1bd87 (diff)
manual: Fix buffer memory leak in appsrc example
g_signal_emit_by_name() is not like gst_app_src_push_buffer() due to reference counting limitations of signals, it does *not* take ownership of the buffer.
-rw-r--r--docs/manual/advanced-dataaccess.xml3
1 files changed, 2 insertions, 1 deletions
diff --git a/docs/manual/advanced-dataaccess.xml b/docs/manual/advanced-dataaccess.xml
index 4853f085e7..10f5d6befa 100644
--- a/docs/manual/advanced-dataaccess.xml
+++ b/docs/manual/advanced-dataaccess.xml
@@ -733,7 +733,7 @@ cb_need_data (GstElement *appsrc,
/* this makes the image black/white */
gst_buffer_memset (buffer, 0, white ? 0xff : 0x0, size);
-
+
white = !white;
GST_BUFFER_PTS (buffer) = timestamp;
@@ -742,6 +742,7 @@ cb_need_data (GstElement *appsrc,
timestamp += GST_BUFFER_DURATION (buffer);
g_signal_emit_by_name (appsrc, "push-buffer", buffer, &ret);
+ gst_buffer_unref (buffer);
if (ret != GST_FLOW_OK) {
/* something wrong, stop pushing */