pad-monitor: avoid tracking tag events

Tag events are hard to track and check if properly serialized because
they mutate too much inside elements. There is no reliable way currently
to match a tag event pushed into an element and another tag event
leaving the element (other than if the pointers are actually the same).
This commit is contained in:
Thiago Santos 2013-08-29 14:26:05 -03:00
parent 1c874d175e
commit 713da78201

View file

@ -1342,6 +1342,27 @@ gst_validate_pad_monitor_chain_func (GstPad * pad, GstObject * parent,
return ret;
}
static gboolean
gst_validate_pad_monitor_event_is_tracked (GstValidatePadMonitor * monitor,
GstEvent * event)
{
if (!GST_EVENT_IS_SERIALIZED (event)) {
return FALSE;
}
/* we don't track Tag events because they mutate too much and it is hard
* to match a tag event pushed on a source pad with the one that was received
* on a sink pad.
* One idea would be to use seqnum, but it seems that it is undefined whether
* seqnums should be maintained in tag events that are created from others
* up to today. (2013-08-29)
*/
if (GST_EVENT_TYPE (event) == GST_EVENT_TAG)
return FALSE;
return TRUE;
}
static gboolean
gst_validate_pad_monitor_sink_event_func (GstPad * pad, GstObject * parent,
GstEvent * event)
@ -1353,7 +1374,7 @@ gst_validate_pad_monitor_sink_event_func (GstPad * pad, GstObject * parent,
GST_VALIDATE_PAD_MONITOR_PARENT_LOCK (pad_monitor);
GST_VALIDATE_MONITOR_LOCK (pad_monitor);
if (GST_EVENT_IS_SERIALIZED (event)) {
if (gst_validate_pad_monitor_event_is_tracked (pad_monitor, event)) {
GstClockTime last_ts;
if (GST_CLOCK_TIME_IS_VALID (pad_monitor->current_timestamp)) {
last_ts = pad_monitor->current_timestamp;