summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2013-01-16 14:48:46 -0500
committerOlivier CrĂȘte <olivier.crete@collabora.com>2013-01-16 14:48:46 -0500
commit936f67b0a090eccbb2475562bb06ec4f2639da5a (patch)
tree123140ae5886caf2a5f878e74649ea7814be66c4
parentb0a149287b9b3a746a3424b48215724dd81810bc (diff)
downloadgstreamer-plugins-bad-936f67b0a090eccbb2475562bb06ec4f2639da5a.tar.gz
uvch264: Prevent temporary elements from going to playing
-rw-r--r--sys/uvch264/gstuvch264_src.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/uvch264/gstuvch264_src.c b/sys/uvch264/gstuvch264_src.c
index e1121c7e4..1a9c5b1e5 100644
--- a/sys/uvch264/gstuvch264_src.c
+++ b/sys/uvch264/gstuvch264_src.c
@@ -29,7 +29,7 @@
*/
#ifdef HAVE_CONFIG_H
-# include <config.h>
+#include <config.h>
#endif
#include <gst/video/video.h>
@@ -2369,7 +2369,7 @@ _transform_caps (GstUvcH264Src * self, GstCaps * caps, const gchar * name)
GstPad *sink;
GstCaps *out_caps = NULL;
- if (!el || !cf || !fs || !gst_bin_add (GST_BIN (self), el)) {
+ if (!el || !cf || !fs) {
if (el)
gst_object_unref (el);
if (cf)
@@ -2378,6 +2378,17 @@ _transform_caps (GstUvcH264Src * self, GstCaps * caps, const gchar * name)
gst_object_unref (fs);
goto done;
}
+
+ gst_element_set_locked_state (el, TRUE);
+ gst_element_set_locked_state (cf, TRUE);
+ gst_element_set_locked_state (fs, TRUE);
+
+ if (!gst_bin_add (GST_BIN (self), el)) {
+ gst_object_unref (el);
+ gst_object_unref (cf);
+ gst_object_unref (fs);
+ goto done;
+ }
if (!gst_bin_add (GST_BIN (self), cf)) {
gst_object_unref (cf);
gst_object_unref (fs);