mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 11:11:08 +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
d97d363b1f
commit
4e97321898
1 changed files with 14 additions and 4 deletions
|
@ -2144,15 +2144,25 @@ void
|
|||
gst_aggregator_set_latency (GstAggregator * self,
|
||||
GstClockTime min_latency, GstClockTime max_latency)
|
||||
{
|
||||
gboolean changed = FALSE;
|
||||
|
||||
g_return_if_fail (GST_IS_AGGREGATOR (self));
|
||||
g_return_if_fail (GST_CLOCK_TIME_IS_VALID (min_latency));
|
||||
g_return_if_fail (max_latency >= min_latency);
|
||||
|
||||
GST_OBJECT_LOCK (self);
|
||||
if (self->priv->sub_latency_min != min_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);
|
||||
|
||||
if (changed) {
|
||||
gst_element_post_message (GST_ELEMENT_CAST (self),
|
||||
gst_message_new_latency (GST_OBJECT_CAST (self)));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue