From ea9bc40bf9885edb26773a69e64ef08d0b1f559e Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 10 Nov 2011 16:00:28 +0100 Subject: [PATCH] audiosrc: avoid deadlock --- gst-libs/gst/audio/gstaudiosrc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gst-libs/gst/audio/gstaudiosrc.c b/gst-libs/gst/audio/gstaudiosrc.c index 57864d1..0691e7c 100644 --- a/gst-libs/gst/audio/gstaudiosrc.c +++ b/gst-libs/gst/audio/gstaudiosrc.c @@ -247,6 +247,11 @@ audioringbuffer_thread_func (GstRingBuffer * buf) GST_OBJECT_LOCK (abuf); if (!abuf->running) goto stop_running; + if (G_UNLIKELY (g_atomic_int_get (&buf->state) == + GST_RING_BUFFER_STATE_STARTED)) { + GST_OBJECT_UNLOCK (abuf); + continue; + } GST_DEBUG_OBJECT (src, "signal wait"); GST_AUDIORING_BUFFER_SIGNAL (buf); GST_DEBUG_OBJECT (src, "wait for action"); -- 2.7.4