From 50781168892e4f179cd37386d9fd3fcad6fb4d07 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Mon, 8 Oct 2018 13:56:56 -0700 Subject: [PATCH] shmsink: do not keep locking if element is unlocked https://bugzilla.gnome.org/show_bug.cgi?id=797260 --- sys/shm/gstshmsink.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/shm/gstshmsink.c b/sys/shm/gstshmsink.c index 5637493..7a0bceb 100644 --- a/sys/shm/gstshmsink.c +++ b/sys/shm/gstshmsink.c @@ -352,6 +352,7 @@ gst_shm_sink_init (GstShmSink * self) { g_cond_init (&self->cond); self->size = DEFAULT_SIZE; + self->unlock = FALSE; self->wait_for_connection = DEFAULT_WAIT_FOR_CONNECTION; self->perms = DEFAULT_PERMS; @@ -670,6 +671,11 @@ gst_shm_sink_render (GstBaseSink * bsink, GstBuffer * buf) gsize written_bytes; GST_OBJECT_LOCK (self); + if (self->unlock) { + GST_OBJECT_UNLOCK (self); + return GST_FLOW_FLUSHING; + } + while (self->wait_for_connection && !self->clients) { g_cond_wait (&self->cond, GST_OBJECT_GET_LOCK (self)); if (self->unlock) { -- 2.7.4