From 581533cd0085a5ed9161a5dccf8394613ef2b1f0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Olivier=20Cr=C3=AAte?= Date: Wed, 17 Mar 2010 21:17:10 +0000 Subject: [PATCH] pad: Drop renegotiate event if there is no getcaps function on a sink pad If there is no custom getcaps function on a sink pad, then changes in downstream caps will never be propagated, so there is no point in trying to renegotiate the capabilities. --- gst/gstpad.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gst/gstpad.c b/gst/gstpad.c index 6ef4af4..2199091 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -4539,6 +4539,9 @@ gst_pad_push_event (GstPad * pad, GstEvent * event) goto flushed; } break; + case GST_EVENT_RENEGOTIATE: + if (GST_PAD_IS_SINK (pad) && GST_PAD_GETCAPSFUNC (pad) == NULL) + goto drop_renegotiate; default: while (G_UNLIKELY (GST_PAD_IS_BLOCKED (pad))) { /* block the event as long as the pad is blocked */ @@ -4920,6 +4923,14 @@ concurrent_stop: GST_OBJECT_UNLOCK (pad); return TRUE; } +drop_renegotiate: + { + GST_CAT_DEBUG_OBJECT (GST_CAT_EVENT, pad, + "No getcaps function on sink pad, dropping renegotiate event"); + gst_event_unref (event); + GST_OBJECT_UNLOCK (pad); + return FALSE; + } } /** -- 2.7.4