diff options
author | Edward Hervey <edward@centricular.com> | 2016-10-08 18:23:08 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2016-10-25 15:59:02 +0300 |
commit | 1fdc091aa8e4071e1e4a208d62441a9f0aeecebc (patch) | |
tree | c3abaabea755a0c31269a37fbc77d90925221c1a | |
parent | 8152f3a3208d657d94e695161fb1580dbc581efb (diff) |
bin: Fix iterator resync'ing
When we get GST_ITERATOR_RESYNC, we need to call gst_iterator_resync()
otherwise we will always get GST_ITERATOR_RESYNC (and that loop would
run forever).
-rw-r--r-- | gst/gstbin.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gst/gstbin.c b/gst/gstbin.c index c9497c8772..01db60ec30 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -2920,10 +2920,13 @@ undo: GST_DEBUG_OBJECT (element, "Bin failed to change state, switching children back to %s", gst_element_state_get_name (current)); - do { + while (TRUE) { ret = gst_iterator_foreach (it, &reset_state, GINT_TO_POINTER (current)); - } while (ret == GST_ITERATOR_RESYNC); + if (ret != GST_ITERATOR_RESYNC) + break; + gst_iterator_resync (it); + } gst_iterator_free (it); } goto done; |