From 8d603b3e1d8d9fed735c338b733a41f44f3ddb63 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Wed, 5 Jul 2023 14:27:22 -0400 Subject: [PATCH] bad: audioaggregator: Do not post message before being constructed `gst_aggregator_set_latency` will post a message on the bus which triggers traces for not constructed objects which fails in rust tracers as object should have names in all traces. Part-of: --- .../gst-libs/gst/audio/gstaudioaggregator.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/audio/gstaudioaggregator.c b/subprojects/gst-plugins-base/gst-libs/gst/audio/gstaudioaggregator.c index 784c047cf3..84c800d637 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/audio/gstaudioaggregator.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/audio/gstaudioaggregator.c @@ -638,12 +638,24 @@ gst_audio_aggregator_recalculate_latency (GstAudioAggregator * aagg) GST_OBJECT_UNLOCK (aagg); } + +static void +gst_audio_aggregator_constructed (GObject * object) +{ + GstAudioAggregator *aagg = GST_AUDIO_AGGREGATOR (object); + + gst_audio_aggregator_translate_output_buffer_duration (aagg, + DEFAULT_OUTPUT_BUFFER_DURATION); + gst_audio_aggregator_recalculate_latency (aagg); +} + static void gst_audio_aggregator_class_init (GstAudioAggregatorClass * klass) { GObjectClass *gobject_class = (GObjectClass *) klass; GstAggregatorClass *gstaggregator_class = (GstAggregatorClass *) klass; + gobject_class->constructed = gst_audio_aggregator_constructed; gobject_class->set_property = gst_audio_aggregator_set_property; gobject_class->get_property = gst_audio_aggregator_get_property; gobject_class->dispose = gst_audio_aggregator_dispose; @@ -759,10 +771,6 @@ gst_audio_aggregator_init (GstAudioAggregator * aagg) aagg->priv->alignment_threshold = DEFAULT_ALIGNMENT_THRESHOLD; aagg->priv->discont_wait = DEFAULT_DISCONT_WAIT; - gst_audio_aggregator_translate_output_buffer_duration (aagg, - DEFAULT_OUTPUT_BUFFER_DURATION); - gst_audio_aggregator_recalculate_latency (aagg); - aagg->current_caps = NULL; aagg->priv->selected_samples_info =