videoaggregator: Let a full renegotiation happen after removing the last pad

With the current code, we will end up setting the preferred downstream
format as the srcpad format, and it might not be accepted by the next
sinkpad to be added. We should instead let the next sinkpad reconfigure
everything.
This commit is contained in:
Thibault Saunier 2014-10-31 11:01:47 +01:00
parent fc593bd2ca
commit a806b40135

View file

@ -1609,13 +1609,22 @@ gst_videoaggregator_release_pad (GstElement * element, GstPad * pad)
{
GstVideoAggregator *vagg = NULL;
GstVideoAggregatorPad *vaggpad;
gboolean update_caps;
gboolean update_caps, last_pad;
vagg = GST_VIDEO_AGGREGATOR (element);
vaggpad = GST_VIDEO_AGGREGATOR_PAD (pad);
GST_VIDEO_AGGREGATOR_LOCK (vagg);
gst_videoaggregator_update_converters (vagg);
GST_OBJECT_LOCK (vagg);
last_pad = (GST_ELEMENT (vagg)->numsinkpads - 1 == 0);
GST_OBJECT_UNLOCK (vagg);
if (!last_pad)
gst_videoaggregator_update_converters (vagg);
else
gst_videoaggregator_reset (vagg);
gst_buffer_replace (&vaggpad->buffer, NULL);
update_caps = GST_VIDEO_INFO_FORMAT (&vagg->info) != GST_VIDEO_FORMAT_UNKNOWN;