diff options
author | Edward Hervey <bilboed@bilboed.com> | 2009-07-28 21:14:11 +0200 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2009-07-29 11:50:06 +0200 |
commit | c138aa8648567f95331a8497dc82cb5e567dc017 (patch) | |
tree | af08124cd3123960adc7046f52169fdae9e7a4cc | |
parent | fcbba9b15a79487cdde9b6db35693783bfd5aae3 (diff) |
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
-rw-r--r-- | libs/gst/base/gstcollectpads.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/libs/gst/base/gstcollectpads.c b/libs/gst/base/gstcollectpads.c index 0d38d835c2..e92df62ef4 100644 --- a/libs/gst/base/gstcollectpads.c +++ b/libs/gst/base/gstcollectpads.c @@ -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); } |