GstIterator iterator;
GstIterator *slave;
+ GMutex *master_lock;
GCompareFunc func;
GValue user_data;
gboolean have_user_data;
result = gst_iterator_next (it->slave, &item);
switch (result) {
case GST_ITERATOR_OK:
- if (G_LIKELY (GST_ITERATOR (it)->lock))
- g_mutex_unlock (GST_ITERATOR (it)->lock);
+ if (G_LIKELY (it->master_lock))
+ g_mutex_unlock (it->master_lock);
if (it->func (&item, &it->user_data) == 0) {
g_value_copy (&item, elem);
done = TRUE;
}
g_value_reset (&item);
- if (G_LIKELY (GST_ITERATOR (it)->lock))
- g_mutex_lock (GST_ITERATOR (it)->lock);
+ if (G_LIKELY (it->master_lock))
+ g_mutex_lock (it->master_lock);
break;
case GST_ITERATOR_RESYNC:
case GST_ITERATOR_DONE:
(GstIteratorResyncFunction) filter_resync,
(GstIteratorFreeFunction) filter_free);
+ result->master_lock = it->lock;
it->lock = NULL;
result->func = func;
if (user_data) {