diff options
author | Thiago Santos <thiagoss@osg.samsung.com> | 2015-05-01 19:39:58 -0300 |
---|---|---|
committer | Thiago Santos <thiagoss@osg.samsung.com> | 2015-05-01 19:45:00 -0300 |
commit | f9f6bbf4f575c3d0f8df61a38e5b97d0933a67c0 (patch) | |
tree | e02c6766e66d06cb18aef3283ce8d8b4a24ed5fc /gst/camerabin2/gstwrappercamerabinsrc.c | |
parent | fc4f95bb7c75216e28b58e735d446cd6b5cb1721 (diff) | |
download | gstreamer-plugins-bad-f9f6bbf4f575c3d0f8df61a38e5b97d0933a67c0.tar.gz |
wrappercamerabinsrc: handle when source creation fail
Remember to set the source to NULL state as adding it to the pipeline
will set it to the READY state.
Diffstat (limited to 'gst/camerabin2/gstwrappercamerabinsrc.c')
-rw-r--r-- | gst/camerabin2/gstwrappercamerabinsrc.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gst/camerabin2/gstwrappercamerabinsrc.c b/gst/camerabin2/gstwrappercamerabinsrc.c index caae45fd0..40d785831 100644 --- a/gst/camerabin2/gstwrappercamerabinsrc.c +++ b/gst/camerabin2/gstwrappercamerabinsrc.c @@ -487,18 +487,18 @@ check_and_replace_src (GstWrapperCameraBinSrc * self) self->app_vid_src, "autovideosrc", DEFAULT_VIDEOSRC, "camerasrc-real-src"))) { self->src_vid_src = NULL; - return FALSE; + goto fail; } if (!gst_bin_add (cbin, self->src_vid_src)) { - return FALSE; + goto fail; } /* check if we already have the next element to link to */ if (self->src_crop) { if (!gst_element_link_pads (self->src_vid_src, "src", self->src_crop, "sink")) { - return FALSE; + goto fail; } } @@ -511,6 +511,11 @@ check_and_replace_src (GstWrapperCameraBinSrc * self) } return TRUE; + +fail: + if (self->src_vid_src) + gst_element_set_state (self->src_vid_src, GST_STATE_NULL); + return FALSE; } /** |