diff options
author | Thiago Santos <thiago.sousa.santos@collabora.com> | 2012-02-16 01:12:58 -0300 |
---|---|---|
committer | Thiago Santos <thiago.sousa.santos@collabora.com> | 2012-02-16 01:30:23 -0300 |
commit | 2ce709cf4a4d46b058218a965885cecfa1568b1f (patch) | |
tree | b2fd2c5b81c4276cef2ee1fe0856a7544934d543 | |
parent | b3592ebda868fd183304789d8448c21abe517fe9 (diff) | |
download | gstreamer-plugins-bad-2ce709cf4a4d46b058218a965885cecfa1568b1f.tar.gz |
wrappercamerabinsrc: Put source in NULL when it fails changing state
When source is being reset to change caps, check the return of
the state syncing function to avoid leaving the source in an
unconsistent state.
-rw-r--r-- | gst/camerabin2/gstwrappercamerabinsrc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gst/camerabin2/gstwrappercamerabinsrc.c b/gst/camerabin2/gstwrappercamerabinsrc.c index 2b4534255..944cd2c2e 100644 --- a/gst/camerabin2/gstwrappercamerabinsrc.c +++ b/gst/camerabin2/gstwrappercamerabinsrc.c @@ -162,7 +162,10 @@ gst_wrapper_camera_bin_reset_video_src_caps (GstWrapperCameraBinSrc * self, self->drop_newseg = TRUE; GST_DEBUG_OBJECT (self, "Bringing source up"); - gst_element_sync_state_with_parent (self->src_vid_src); + if (!gst_element_sync_state_with_parent (self->src_vid_src)) { + GST_WARNING_OBJECT (self, "Failed to reset source caps"); + gst_element_set_state (self->src_vid_src, GST_STATE_NULL); + } if (clock) { gst_element_set_clock (self->src_vid_src, clock); |