Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/GStreamer/gstreamer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2016-12-05 12:01:45 +0300
committerSebastian Dröge <sebastian@centricular.com>2016-12-05 12:02:15 +0300
commit10e1acaef5a760558a5e3cd7aabcf67a60fac587 (patch)
treeee7ead86d6dece0ca59d71c001190976b78bddc3
parentc55c942f584cb7a88d0b9093eecfa8d18c0b39a5 (diff)
elements: Handle GstIterator RESYNC return value correctly in gst_iterator_foreach()
-rw-r--r--plugins/elements/gstconcat.c16
-rw-r--r--plugins/elements/gsttee.c6
2 files changed, 12 insertions, 10 deletions
diff --git a/plugins/elements/gstconcat.c b/plugins/elements/gstconcat.c
index 865b41c950..788cc9c780 100644
--- a/plugins/elements/gstconcat.c
+++ b/plugins/elements/gstconcat.c
@@ -800,10 +800,10 @@ gst_concat_change_state (GstElement * element, GstStateChange transition)
self->current_start_offset = 0;
self->last_stop = GST_CLOCK_TIME_NONE;
- do {
- res = gst_iterator_foreach (iter, reset_pad, NULL);
- } while (res == GST_ITERATOR_RESYNC);
-
+ while ((res =
+ gst_iterator_foreach (iter, reset_pad,
+ NULL)) == GST_ITERATOR_RESYNC)
+ gst_iterator_resync (iter);
gst_iterator_free (iter);
if (res == GST_ITERATOR_ERROR)
@@ -815,10 +815,10 @@ gst_concat_change_state (GstElement * element, GstStateChange transition)
GstIteratorResult res;
g_mutex_lock (&self->lock);
- do {
- res = gst_iterator_foreach (iter, unblock_pad, NULL);
- } while (res == GST_ITERATOR_RESYNC);
-
+ while ((res =
+ gst_iterator_foreach (iter, unblock_pad,
+ NULL)) == GST_ITERATOR_RESYNC)
+ gst_iterator_resync (iter);
gst_iterator_free (iter);
g_cond_broadcast (&self->cond);
g_mutex_unlock (&self->lock);
diff --git a/plugins/elements/gsttee.c b/plugins/elements/gsttee.c
index 906775d2ae..2369814bdf 100644
--- a/plugins/elements/gsttee.c
+++ b/plugins/elements/gsttee.c
@@ -971,8 +971,10 @@ gst_tee_pull_eos (GstTee * tee)
GstIterator *iter;
iter = gst_element_iterate_src_pads (GST_ELEMENT (tee));
- gst_iterator_foreach (iter, (GstIteratorForeachFunction) gst_tee_push_eos,
- tee);
+ while (gst_iterator_foreach (iter,
+ (GstIteratorForeachFunction) gst_tee_push_eos,
+ tee) == GST_ITERATOR_RESYNC)
+ gst_iterator_resync (iter);
gst_iterator_free (iter);
}