Commit d9f1b373 authored by Håvard Graff's avatar Håvard Graff Committed by Wim Taymans

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

Fixes #635784
parent 75c337c7
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment