wrappercamerabinsrc: simplify weird if/else clause

It is not an if/else situation but an if error abort otherwise
just continue. Remove else to make it more readable
This commit is contained in:
Thiago Santos 2015-01-05 15:16:15 -03:00
parent 50b5d94b2a
commit 42b510fd1b

View file

@ -441,6 +441,7 @@ check_and_replace_src (GstWrapperCameraBinSrc * self)
{
GstBin *cbin = GST_BIN_CAST (self);
GstBaseCameraSrc *bcamsrc = GST_BASE_CAMERA_SRC_CAST (self);
GstElement *videoconvert;
if (self->src_vid_src && self->src_vid_src == self->app_vid_src) {
GST_DEBUG_OBJECT (self, "No need to change current videosrc");
@ -473,22 +474,20 @@ check_and_replace_src (GstWrapperCameraBinSrc * self)
"camerasrc-real-src"))) {
self->src_vid_src = NULL;
return FALSE;
} else {
GstElement *videoconvert;
if (!gst_bin_add (cbin, self->src_vid_src)) {
}
if (!gst_bin_add (cbin, self->src_vid_src)) {
return FALSE;
}
/* check if we already have the next element to link to */
videoconvert = gst_bin_get_by_name (cbin, "src-videoconvert");
if (videoconvert) {
if (!gst_element_link_pads (self->src_vid_src, "src", videoconvert, "sink")) {
gst_object_unref (videoconvert);
return FALSE;
}
/* check if we already have the next element to link to */
videoconvert = gst_bin_get_by_name (cbin, "src-videoconvert");
if (videoconvert) {
if (!gst_element_link_pads (self->src_vid_src, "src", videoconvert,
"sink")) {
gst_object_unref (videoconvert);
return FALSE;
}
gst_object_unref (videoconvert);
}
gst_object_unref (videoconvert);
}
/* we listen for changes to max-zoom in the video src so that