diff options
author | Thiago Santos <thiagoss@osg.samsung.com> | 2015-01-05 15:16:15 -0300 |
---|---|---|
committer | Thiago Santos <thiagoss@osg.samsung.com> | 2015-01-05 17:59:08 -0300 |
commit | 42b510fd1b63ba8bb52eaf5817c39e2e2c8a2f1c (patch) | |
tree | 2a5cd745e42b1f32fab8b93c557cf7437eb3c32b /gst/camerabin2 | |
parent | 50b5d94b2a1dfa702107c9f9203baf6df517f61e (diff) | |
download | gstreamer-plugins-bad-42b510fd1b63ba8bb52eaf5817c39e2e2c8a2f1c.tar.gz |
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
Diffstat (limited to 'gst/camerabin2')
-rw-r--r-- | gst/camerabin2/gstwrappercamerabinsrc.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/gst/camerabin2/gstwrappercamerabinsrc.c b/gst/camerabin2/gstwrappercamerabinsrc.c index 6023e442b..892bac328 100644 --- a/gst/camerabin2/gstwrappercamerabinsrc.c +++ b/gst/camerabin2/gstwrappercamerabinsrc.c @@ -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)) { - 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; - } + 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; } + gst_object_unref (videoconvert); } /* we listen for changes to max-zoom in the video src so that |