[0.10] gst-plugins-bad: wrappercamerabinsrc: Put source in NULL when it fails changing state

Tim Müller tpm at kemper.freedesktop.org
Thu Feb 16 05:49:03 PST 2012


Module: gst-plugins-bad
Branch: 0.10
Commit: 13227245ab9c88aecdf173bcb98ca6835050688e
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=13227245ab9c88aecdf173bcb98ca6835050688e

Author: Thiago Santos <thiago.sousa.santos at collabora.com>
Date:   Thu Feb 16 01:12:58 2012 -0300

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.

---

 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 1fc71c0..b519ba3 100644
--- a/gst/camerabin2/gstwrappercamerabinsrc.c
+++ b/gst/camerabin2/gstwrappercamerabinsrc.c
@@ -158,7 +158,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);



More information about the gstreamer-commits mailing list