From ea5900d12ffbaf8a02b2599c0810e7a6db2c7b71 Mon Sep 17 00:00:00 2001 From: Stefan Sauer Date: Thu, 5 Oct 2017 08:11:29 +0200 Subject: [PATCH] audioaggregator: pass blocksize to mix_buffer() No need to recalc the value twice per run. Establishes that it is the same value. --- gst-libs/gst/audio/gstaudioaggregator.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/gst-libs/gst/audio/gstaudioaggregator.c b/gst-libs/gst/audio/gstaudioaggregator.c index 202474b845..c7f7583348 100644 --- a/gst-libs/gst/audio/gstaudioaggregator.c +++ b/gst-libs/gst/audio/gstaudioaggregator.c @@ -973,19 +973,15 @@ done: static gboolean gst_audio_aggregator_mix_buffer (GstAudioAggregator * aagg, - GstAudioAggregatorPad * pad, GstBuffer * inbuf, GstBuffer * outbuf) + GstAudioAggregatorPad * pad, GstBuffer * inbuf, GstBuffer * outbuf, + guint blocksize) { guint overlap; guint out_start; gboolean filled; - guint blocksize; guint in_offset; gboolean pad_changed = FALSE; - blocksize = gst_util_uint64_scale (aagg->priv->output_buffer_duration, - GST_AUDIO_INFO_RATE (&aagg->info), GST_SECOND); - blocksize = MAX (1, blocksize); - /* Overlap => mix */ if (aagg->priv->offset < pad->priv->output_offset) out_start = pad->priv->output_offset - aagg->priv->offset; @@ -1295,7 +1291,7 @@ gst_audio_aggregator_aggregate (GstAggregator * agg, gboolean timeout) GST_LOG_OBJECT (aggpad, "Mixing buffer for current offset"); drop_buf = !gst_audio_aggregator_mix_buffer (aagg, pad, pad->priv->buffer, - outbuf); + outbuf, blocksize); if (pad->priv->output_offset >= next_offset) { GST_LOG_OBJECT (pad, "Pad is at or after current offset: %" G_GUINT64_FORMAT " >= %"