audiosrc: avoid deadlock

This commit is contained in:
Wim Taymans 2011-11-10 16:00:28 +01:00
parent e02a164a36
commit ea9bc40bf9

View file

@ -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");