diff --git a/gst-libs/gst/audio/gstringbuffer.c b/gst-libs/gst/audio/gstringbuffer.c index 2989d06433..87d1ce2fb4 100644 --- a/gst-libs/gst/audio/gstringbuffer.c +++ b/gst-libs/gst/audio/gstringbuffer.c @@ -1085,6 +1085,9 @@ gst_ring_buffer_start (GstRingBuffer * buf) if (G_UNLIKELY (!buf->acquired)) goto not_acquired; + if (G_UNLIKELY (g_atomic_int_get (&buf->abidata.ABI.may_start) == FALSE)) + goto may_not_start; + /* if stopped, set to started */ res = g_atomic_int_compare_and_exchange (&buf->state, GST_RING_BUFFER_STATE_STOPPED, GST_RING_BUFFER_STATE_STARTED); @@ -1137,6 +1140,12 @@ not_acquired: GST_OBJECT_UNLOCK (buf); return FALSE; } +may_not_start: + { + GST_DEBUG_OBJECT (buf, "we may not start"); + GST_OBJECT_UNLOCK (buf); + return FALSE; + } } static gboolean