From 07f59f540490733e4c423f3dc1a8b4c523e2d432 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 3 May 2011 14:13:59 +0200 Subject: [PATCH] basesrc: Use the reconfigure flag on the pad instead of the event --- libs/gst/base/gstbasesrc.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/libs/gst/base/gstbasesrc.c b/libs/gst/base/gstbasesrc.c index 8b312dce6d..3aecdb0f98 100644 --- a/libs/gst/base/gstbasesrc.c +++ b/libs/gst/base/gstbasesrc.c @@ -247,8 +247,6 @@ struct _GstBaseSrcPrivate gboolean qos_enabled; gdouble proportion; GstClockTime earliest_time; - - gboolean renegotiate; }; static GstElementClass *parent_class = NULL; @@ -1737,12 +1735,6 @@ gst_base_src_default_event (GstBaseSrc * src, GstEvent * event) result = TRUE; break; } - case GST_EVENT_RENEGOTIATE: - { - g_atomic_int_set (&src->priv->renegotiate, TRUE); - result = TRUE; - break; - } default: result = FALSE; break; @@ -2369,13 +2361,18 @@ gst_base_src_loop (GstPad * pad) gboolean eos; gulong blocksize; GList *pending_events = NULL, *tmp; + gboolean reconfigure; eos = FALSE; src = GST_BASE_SRC (GST_OBJECT_PARENT (pad)); + GST_OBJECT_LOCK (pad); + reconfigure = GST_PAD_NEEDS_RECONFIGURE (pad); + GST_OBJECT_FLAG_UNSET (pad, GST_PAD_NEED_RECONFIGURE); + GST_OBJECT_UNLOCK (pad); /* check if we need to renegotiate */ - if (g_atomic_int_compare_and_exchange (&src->priv->renegotiate, TRUE, FALSE)) { + if (reconfigure) { if (!gst_base_src_negotiate (src)) GST_DEBUG_OBJECT (src, "Failed to renegotiate"); }