From ed18ceffe66715975fec608bfc702f1703df4a1c Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Wed, 24 Jun 2009 11:11:35 +0200 Subject: [PATCH] collectpads: Update the cookie when setting ourselves as flushing. This forces the pad status to be re-evaluated on the next _check_pads(). --- libs/gst/base/gstcollectpads.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libs/gst/base/gstcollectpads.c b/libs/gst/base/gstcollectpads.c index 97fa9b3812..c8b7aaf8c6 100644 --- a/libs/gst/base/gstcollectpads.c +++ b/libs/gst/base/gstcollectpads.c @@ -517,6 +517,8 @@ gst_collect_pads_set_flushing_unlocked (GstCollectPads * pads, { GSList *walk = NULL; + GST_DEBUG ("Setting flushing (%d)", flushing); + /* Update the pads flushing flag */ for (walk = pads->data; walk; walk = g_slist_next (walk)) { GstCollectData *cdata = walk->data; @@ -532,6 +534,10 @@ gst_collect_pads_set_flushing_unlocked (GstCollectPads * pads, GST_OBJECT_UNLOCK (cdata->pad); } } + /* Setting the pads to flushing means that we changed the values which + * are 'protected' by the cookie. We therefore update it to force a + * recalculation of the current pad status. */ + pads->abidata.ABI.pad_cookie++; } /** @@ -969,6 +975,8 @@ gst_collect_pads_check_pads (GstCollectPads * pads) { /* the master list and cookie are protected with the PAD_LOCK */ GST_COLLECT_PADS_PAD_LOCK (pads); + GST_DEBUG ("stored cookie : %d, used_cookie:%d", + pads->abidata.ABI.pad_cookie, pads->cookie); if (G_UNLIKELY (pads->abidata.ABI.pad_cookie != pads->cookie)) { GSList *collected;