mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-21 13:36:39 +00:00
aggregator: only post latency message if anything changed
Perhaps we should check for element state as well and only post it if in PLAYING state.
This commit is contained in:
parent
9c21327a8d
commit
55abf436a0
1 changed files with 14 additions and 4 deletions
|
@ -2144,15 +2144,25 @@ void
|
||||||
gst_aggregator_set_latency (GstAggregator * self,
|
gst_aggregator_set_latency (GstAggregator * self,
|
||||||
GstClockTime min_latency, GstClockTime max_latency)
|
GstClockTime min_latency, GstClockTime max_latency)
|
||||||
{
|
{
|
||||||
|
gboolean changed = FALSE;
|
||||||
|
|
||||||
g_return_if_fail (GST_IS_AGGREGATOR (self));
|
g_return_if_fail (GST_IS_AGGREGATOR (self));
|
||||||
g_return_if_fail (GST_CLOCK_TIME_IS_VALID (min_latency));
|
g_return_if_fail (GST_CLOCK_TIME_IS_VALID (min_latency));
|
||||||
g_return_if_fail (max_latency >= min_latency);
|
g_return_if_fail (max_latency >= min_latency);
|
||||||
|
|
||||||
GST_OBJECT_LOCK (self);
|
GST_OBJECT_LOCK (self);
|
||||||
self->priv->sub_latency_min = min_latency;
|
if (self->priv->sub_latency_min != min_latency) {
|
||||||
self->priv->sub_latency_max = max_latency;
|
self->priv->sub_latency_min = min_latency;
|
||||||
|
changed = TRUE;
|
||||||
|
}
|
||||||
|
if (self->priv->sub_latency_max != max_latency) {
|
||||||
|
self->priv->sub_latency_max = max_latency;
|
||||||
|
changed = TRUE;
|
||||||
|
}
|
||||||
GST_OBJECT_UNLOCK (self);
|
GST_OBJECT_UNLOCK (self);
|
||||||
|
|
||||||
gst_element_post_message (GST_ELEMENT_CAST (self),
|
if (changed) {
|
||||||
gst_message_new_latency (GST_OBJECT_CAST (self)));
|
gst_element_post_message (GST_ELEMENT_CAST (self),
|
||||||
|
gst_message_new_latency (GST_OBJECT_CAST (self)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue