summaryrefslogtreecommitdiff
path: root/sys/shm/gstshmsink.c
diff options
context:
space:
mode:
authorAleix Conchillo Flaque <aleix@oblong.com>2013-06-19 12:52:52 -0700
committerOlivier CrĂȘte <olivier.crete@collabora.com>2013-06-19 18:36:19 -0400
commit44807dcc1a4052f460d06f3b9b29e45c12e17113 (patch)
tree88f699661dd24fcf6e482ef8cb8af0eb5d636ba7 /sys/shm/gstshmsink.c
parentc0ce94dbf2f0982301edf4adb4c618e06ee3f43e (diff)
downloadgstreamer-plugins-bad-44807dcc1a4052f460d06f3b9b29e45c12e17113.tar.gz
shmsink: unref buffer if no clients are connected
If no client has received the command, unref the buffer. This will make sure that the shared memory area does not get filled with buffers no one knows about. https://bugzilla.gnome.org/show_bug.cgi?id=702684
Diffstat (limited to 'sys/shm/gstshmsink.c')
-rw-r--r--sys/shm/gstshmsink.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/shm/gstshmsink.c b/sys/shm/gstshmsink.c
index 1310847d5..cbebdf5ef 100644
--- a/sys/shm/gstshmsink.c
+++ b/sys/shm/gstshmsink.c
@@ -743,7 +743,10 @@ gst_shm_sink_render (GstBaseSink * bsink, GstBuffer * buf)
GST_OBJECT_UNLOCK (self);
- if (rv == -1) {
+ if (rv == 0) {
+ GST_DEBUG_OBJECT (self, "No clients connected, unreffing buffer");
+ gst_buffer_unref (sendbuf);
+ } else if (rv == -1) {
GST_ELEMENT_ERROR (self, STREAM, FAILED, ("Invalid allocated buffer"),
("The shmpipe library rejects our buffer, this is a bug"));
ret = GST_FLOW_ERROR;