From 01520c7e4781c3d5bff3d1b2a5e123ad085e4bd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= Date: Sat, 15 Nov 2014 17:54:51 -0500 Subject: [PATCH] audioaggregator: Don't re-send the caps if they did not change https://bugzilla.gnome.org/show_bug.cgi?id=740236 --- gst/audiomixer/gstaudioaggregator.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gst/audiomixer/gstaudioaggregator.c b/gst/audiomixer/gstaudioaggregator.c index 5939c1dc92..2fb0a41eac 100644 --- a/gst/audiomixer/gstaudioaggregator.c +++ b/gst/audiomixer/gstaudioaggregator.c @@ -635,11 +635,14 @@ gst_audio_aggregator_set_src_caps (GstAudioAggregator * aagg, GstCaps * caps) GST_AUDIO_AGGREGATOR_LOCK (aagg); GST_OBJECT_LOCK (aagg); - GST_INFO_OBJECT (aagg, "setting caps to %" GST_PTR_FORMAT, caps); - gst_caps_replace (&aagg->current_caps, caps); + if (!gst_audio_info_is_equal (&info, &aagg->info)) { + GST_INFO_OBJECT (aagg, "setting caps to %" GST_PTR_FORMAT, caps); + gst_caps_replace (&aagg->current_caps, caps); - memcpy (&aagg->info, &info, sizeof (info)); - aagg->priv->send_caps = TRUE; + memcpy (&aagg->info, &info, sizeof (info)); + aagg->priv->send_caps = TRUE; + + } GST_OBJECT_UNLOCK (aagg); GST_AUDIO_AGGREGATOR_UNLOCK (aagg);