playbasebin: Update for new GstIterator API

This commit is contained in:
Sebastian Dröge 2011-05-05 18:35:46 +02:00
parent 5bb005ad51
commit b015e5e763

View file

@ -1871,6 +1871,7 @@ analyse_source (GstPlayBaseBin * play_base_bin, gboolean * is_raw,
GstIterator *pads_iter; GstIterator *pads_iter;
gboolean done = FALSE; gboolean done = FALSE;
gboolean res = TRUE; gboolean res = TRUE;
GValue item = { 0, };
*have_out = FALSE; *have_out = FALSE;
*is_raw = FALSE; *is_raw = FALSE;
@ -1880,7 +1881,7 @@ analyse_source (GstPlayBaseBin * play_base_bin, gboolean * is_raw,
while (!done) { while (!done) {
GstPad *pad = NULL; GstPad *pad = NULL;
switch (gst_iterator_next (pads_iter, (gpointer) & pad)) { switch (gst_iterator_next (pads_iter, &item)) {
case GST_ITERATOR_ERROR: case GST_ITERATOR_ERROR:
res = FALSE; res = FALSE;
/* FALLTROUGH */ /* FALLTROUGH */
@ -1895,12 +1896,13 @@ analyse_source (GstPlayBaseBin * play_base_bin, gboolean * is_raw,
gst_iterator_resync (pads_iter); gst_iterator_resync (pads_iter);
break; break;
case GST_ITERATOR_OK: case GST_ITERATOR_OK:
pad = g_value_get_object (&item);
/* we now officially have an ouput pad */ /* we now officially have an ouput pad */
*have_out = TRUE; *have_out = TRUE;
/* if FALSE, this pad has no caps and we continue with the next pad. */ /* if FALSE, this pad has no caps and we continue with the next pad. */
if (!has_all_raw_caps (pad, is_raw)) { if (!has_all_raw_caps (pad, is_raw)) {
gst_object_unref (pad); g_value_reset (&item);
break; break;
} }
@ -1910,10 +1912,11 @@ analyse_source (GstPlayBaseBin * play_base_bin, gboolean * is_raw,
play_base_bin, FALSE); play_base_bin, FALSE);
} }
gst_object_unref (pad); g_value_reset (&item);
break; break;
} }
} }
g_value_unset (&item);
gst_iterator_free (pads_iter); gst_iterator_free (pads_iter);
if (!*have_out) { if (!*have_out) {