mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 01:45:33 +00:00
basesink: Don't bother the subclass with setting the same caps multiple times
This commit is contained in:
parent
674b555bec
commit
acc295c93b
1 changed files with 16 additions and 7 deletions
|
@ -3069,11 +3069,17 @@ gst_base_sink_default_event (GstBaseSink * basesink, GstEvent * event)
|
||||||
}
|
}
|
||||||
case GST_EVENT_CAPS:
|
case GST_EVENT_CAPS:
|
||||||
{
|
{
|
||||||
GstCaps *caps;
|
GstCaps *caps, *current_caps;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (basesink, "caps %p", event);
|
GST_DEBUG_OBJECT (basesink, "caps %p", event);
|
||||||
|
|
||||||
gst_event_parse_caps (event, &caps);
|
gst_event_parse_caps (event, &caps);
|
||||||
|
current_caps = gst_pad_get_current_caps (GST_BASE_SINK_PAD (basesink));
|
||||||
|
|
||||||
|
if (current_caps && gst_caps_is_equal (current_caps, caps)) {
|
||||||
|
GST_DEBUG_OBJECT (basesink,
|
||||||
|
"New caps equal to old ones: %" GST_PTR_FORMAT, caps);
|
||||||
|
} else {
|
||||||
if (bclass->set_caps)
|
if (bclass->set_caps)
|
||||||
result = bclass->set_caps (basesink, caps);
|
result = bclass->set_caps (basesink, caps);
|
||||||
|
|
||||||
|
@ -3082,6 +3088,9 @@ gst_base_sink_default_event (GstBaseSink * basesink, GstEvent * event)
|
||||||
gst_caps_replace (&basesink->priv->caps, caps);
|
gst_caps_replace (&basesink->priv->caps, caps);
|
||||||
GST_OBJECT_UNLOCK (basesink);
|
GST_OBJECT_UNLOCK (basesink);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (current_caps)
|
||||||
|
gst_caps_unref (current_caps);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GST_EVENT_SEGMENT:
|
case GST_EVENT_SEGMENT:
|
||||||
|
|
Loading…
Reference in a new issue