wrappercamerabinsrc: Do not re-set the clock if it is null

Avoids not needed work and doesn't assert when trying to
unref the null reference
This commit is contained in:
Thiago Santos 2011-02-08 11:24:59 -03:00
parent ab2b9079f0
commit 15366355a4

View file

@ -185,11 +185,13 @@ gst_wrapper_camera_bin_reset_video_src_caps (GstWrapperCameraBinSrc * self,
GST_DEBUG_OBJECT (self, "Bringing source up");
gst_element_sync_state_with_parent (self->src_vid_src);
if (clock) {
gst_element_set_clock (self->src_vid_src, clock);
gst_element_set_base_time (self->src_vid_src, base_time);
if (GST_IS_BIN (self->src_vid_src)) {
GstIterator *it = gst_bin_iterate_elements (GST_BIN (self->src_vid_src));
GstIterator *it =
gst_bin_iterate_elements (GST_BIN (self->src_vid_src));
gpointer item = NULL;
gboolean done = FALSE;
while (!done) {
@ -214,6 +216,7 @@ gst_wrapper_camera_bin_reset_video_src_caps (GstWrapperCameraBinSrc * self,
gst_object_unref (clock);
}
}
}
/**