From af2707d3a3397ee715a19b74de5ccfb29db098d8 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Mon, 8 Dec 2014 17:17:08 -0300 Subject: [PATCH] pad-monitor: Only add pending caps fields for source pads As caps events are downstream, caps set travels from sinks to sources. Adding pending setcaps values to sink pads makes no sense as when a new caps is set on the sink it would compare with values currently set on the source pad, causing a critical failure when renegotiation happens. --- validate/gst/validate/gst-validate-pad-monitor.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/validate/gst/validate/gst-validate-pad-monitor.c b/validate/gst/validate/gst-validate-pad-monitor.c index ea342d8..5abcc79 100644 --- a/validate/gst/validate/gst-validate-pad-monitor.c +++ b/validate/gst/validate/gst-validate-pad-monitor.c @@ -2302,8 +2302,12 @@ gst_validate_pad_monitor_setcaps_pre (GstValidatePadMonitor * pad_monitor, } } - if (gst_validate_pad_monitor_pad_should_proxy_othercaps (pad_monitor)) { + if (GST_PAD_IS_SINK (GST_VALIDATE_PAD_MONITOR_GET_PAD (pad_monitor)) && + gst_validate_pad_monitor_pad_should_proxy_othercaps (pad_monitor)) { if (_structure_is_video (structure)) { + GST_DEBUG_OBJECT (GST_VALIDATE_PAD_MONITOR_GET_PAD (pad_monitor), + "Adding video common pending fields to other pad: %" GST_PTR_FORMAT, + structure); gst_validate_pad_monitor_otherpad_add_pending_field (pad_monitor, structure, "width"); gst_validate_pad_monitor_otherpad_add_pending_field (pad_monitor, @@ -2313,6 +2317,9 @@ gst_validate_pad_monitor_setcaps_pre (GstValidatePadMonitor * pad_monitor, gst_validate_pad_monitor_otherpad_add_pending_field (pad_monitor, structure, "pixel-aspect-ratio"); } else if (_structure_is_audio (structure)) { + GST_DEBUG_OBJECT (GST_VALIDATE_PAD_MONITOR_GET_PAD (pad_monitor), + "Adding audio common pending fields to other pad: %" GST_PTR_FORMAT, + structure); gst_validate_pad_monitor_otherpad_add_pending_field (pad_monitor, structure, "rate"); gst_validate_pad_monitor_otherpad_add_pending_field (pad_monitor, -- 2.7.4