Stop iteration if there is no more element to examine.

This commit is contained in:
gb 2010-05-11 12:03:13 +00:00 committed by Gwenole Beauchesne
parent 608d2d071b
commit bceab0254c

View file

@ -105,12 +105,13 @@ gst_vaapi_video_sink_lookup(GstElement *element)
break;
element = gst_pad_get_parent_element(peer);
if (element) {
if (GST_VAAPI_IS_VIDEO_SINK(element))
sink = GST_VAAPI_VIDEO_SINK(element);
g_object_unref(element);
}
g_object_unref(peer);
if (!element)
break;
if (GST_VAAPI_IS_VIDEO_SINK(element))
sink = GST_VAAPI_VIDEO_SINK(element);
g_object_unref(element);
}
return sink;
}