ringbuffer: make sure to not start if the may_start flag is FALSE

Fixes #635784
This commit is contained in:
Håvard Graff 2010-11-25 17:01:53 +01:00 committed by Wim Taymans
parent 75c337c726
commit d9f1b3736e

View file

@ -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