From 0566ea06e50d09be2c0b0c2fa971ff7eb181353b Mon Sep 17 00:00:00 2001 From: Stefan Sauer Date: Thu, 20 Feb 2014 22:52:57 +0100 Subject: [PATCH] autodetect: check if the kid has a sync property previously autovideosrc did not have a sync property and v4l2src has none either. --- gst/autodetect/gstautodetect.c | 7 +++++-- gst/autodetect/gstautodetect.h | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gst/autodetect/gstautodetect.c b/gst/autodetect/gstautodetect.c index 9497c0cf37..a3a1c8a6d4 100644 --- a/gst/autodetect/gstautodetect.c +++ b/gst/autodetect/gstautodetect.c @@ -349,7 +349,10 @@ gst_auto_detect_detect (GstAutoDetect * self) if (!(kid = gst_auto_detect_find_best (self))) goto no_sink; - g_object_set (G_OBJECT (kid), "sync", self->sync, NULL); + self->has_sync = + g_object_class_find_property (G_OBJECT_GET_CLASS (kid), "sync") != NULL; + if (self->has_sync) + g_object_set (G_OBJECT (kid), "sync", self->sync, NULL); if (klass->configure) { klass->configure (self, kid); } @@ -432,7 +435,7 @@ gst_auto_detect_set_property (GObject * object, guint prop_id, break; case PROP_SYNC: self->sync = g_value_get_boolean (value); - if (self->kid) + if (self->kid && self->has_sync) g_object_set_property (G_OBJECT (self->kid), pspec->name, value); break; default: diff --git a/gst/autodetect/gstautodetect.h b/gst/autodetect/gstautodetect.h index 105c28929d..03b06aed7b 100644 --- a/gst/autodetect/gstautodetect.h +++ b/gst/autodetect/gstautodetect.h @@ -51,6 +51,7 @@ typedef struct _GstAutoDetect { /* < private > */ GstElement *kid; + gboolean has_sync; const gchar *type_klass; /* Source/Sink */ const gchar *media_klass_lc, *type_klass_lc; /* lower case versions */