mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 19:20:35 +00:00
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
This commit is contained in:
parent
c0ce94dbf2
commit
44807dcc1a
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue