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); GstBin *cbin = GST_BIN_CAST (self);
GstBaseCameraSrc *bcamsrc = GST_BASE_CAMERA_SRC_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) { if (self->src_vid_src && self->src_vid_src == self->app_vid_src) {
GST_DEBUG_OBJECT (self, "No need to change current videosrc"); GST_DEBUG_OBJECT (self, "No need to change current videosrc");
@ -473,8 +474,8 @@ check_and_replace_src (GstWrapperCameraBinSrc * self)
"camerasrc-real-src"))) { "camerasrc-real-src"))) {
self->src_vid_src = NULL; self->src_vid_src = NULL;
return FALSE; 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; return FALSE;
} }
@ -482,14 +483,12 @@ check_and_replace_src (GstWrapperCameraBinSrc * self)
/* check if we already have the next element to link to */ /* check if we already have the next element to link to */
videoconvert = gst_bin_get_by_name (cbin, "src-videoconvert"); videoconvert = gst_bin_get_by_name (cbin, "src-videoconvert");
if (videoconvert) { if (videoconvert) {
if (!gst_element_link_pads (self->src_vid_src, "src", videoconvert, if (!gst_element_link_pads (self->src_vid_src, "src", videoconvert, "sink")) {
"sink")) {
gst_object_unref (videoconvert); gst_object_unref (videoconvert);
return FALSE; return FALSE;
} }
gst_object_unref (videoconvert); gst_object_unref (videoconvert);
} }
}
/* we listen for changes to max-zoom in the video src so that /* we listen for changes to max-zoom in the video src so that
* we can proxy them to the basecamerasrc property */ * we can proxy them to the basecamerasrc property */