mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 03:01:03 +00:00
ringbuffer: make sure to not start if the may_start flag is FALSE
Fixes #635784
This commit is contained in:
parent
75c337c726
commit
d9f1b3736e
1 changed files with 9 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue