mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
collectpads: Make sure the CollectData list is up-to-date when reading/setting it
Without this, we risked: * Checking the flushing state on an unexisting list * Not setting the flushing state on pads that had just been added Partially fixes #590056
This commit is contained in:
parent
fcbba9b15a
commit
c138aa8648
1 changed files with 15 additions and 4 deletions
|
@ -510,16 +510,25 @@ gst_collect_pads_collect_range (GstCollectPads * pads, guint64 offset,
|
|||
static gboolean
|
||||
gst_collect_pads_is_flushing (GstCollectPads * pads)
|
||||
{
|
||||
GSList *walk = pads->data;
|
||||
GSList *walk = NULL;
|
||||
gboolean res = TRUE;
|
||||
|
||||
GST_COLLECT_PADS_PAD_LOCK (pads);
|
||||
while (walk) {
|
||||
|
||||
/* Ensure pads->data state */
|
||||
gst_collect_pads_check_pads_unlocked (pads);
|
||||
|
||||
GST_DEBUG ("Getting flushing state (pads:%p, pads->data:%p)",
|
||||
pads, pads->data);
|
||||
|
||||
for (walk = pads->data; walk; walk = g_slist_next (walk)) {
|
||||
GstCollectData *cdata = walk->data;
|
||||
|
||||
if (cdata->abidata.ABI.flushing)
|
||||
GST_DEBUG_OBJECT (cdata->pad, "flushing:%d", cdata->abidata.ABI.flushing);
|
||||
|
||||
if (cdata->abidata.ABI.flushing) {
|
||||
goto done;
|
||||
walk = g_slist_next (walk);
|
||||
}
|
||||
}
|
||||
|
||||
res = FALSE;
|
||||
|
@ -582,6 +591,8 @@ gst_collect_pads_set_flushing (GstCollectPads * pads, gboolean flushing)
|
|||
g_return_if_fail (GST_IS_COLLECT_PADS (pads));
|
||||
|
||||
GST_COLLECT_PADS_PAD_LOCK (pads);
|
||||
/* Ensure pads->data state */
|
||||
gst_collect_pads_check_pads_unlocked (pads);
|
||||
gst_collect_pads_set_flushing_unlocked (pads, flushing);
|
||||
GST_COLLECT_PADS_PAD_UNLOCK (pads);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue