From f8f9c72cc59ce499f2de85d6635e0d6a867555d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= Date: Tue, 21 Jul 2015 20:52:23 -0400 Subject: [PATCH] audioaggregator: Read output buffer duration with lock held --- gst/audiomixer/gstaudioaggregator.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gst/audiomixer/gstaudioaggregator.c b/gst/audiomixer/gstaudioaggregator.c index eb2fb1ebd7..01704f5330 100644 --- a/gst/audiomixer/gstaudioaggregator.c +++ b/gst/audiomixer/gstaudioaggregator.c @@ -1011,10 +1011,6 @@ gst_audio_aggregator_aggregate (GstAggregator * agg, gboolean timeout) element = GST_ELEMENT (agg); aagg = GST_AUDIO_AGGREGATOR (agg); - blocksize = gst_util_uint64_scale (aagg->priv->output_buffer_duration, - GST_AUDIO_INFO_RATE (&aagg->info), GST_SECOND); - blocksize = MAX (1, blocksize); - GST_AUDIO_AGGREGATOR_LOCK (aagg); GST_OBJECT_LOCK (agg); @@ -1062,6 +1058,9 @@ gst_audio_aggregator_aggregate (GstAggregator * agg, gboolean timeout) rate = GST_AUDIO_INFO_RATE (&aagg->info); bpf = GST_AUDIO_INFO_BPF (&aagg->info); + blocksize = gst_util_uint64_scale (aagg->priv->output_buffer_duration, + GST_AUDIO_INFO_RATE (&aagg->info), GST_SECOND); + blocksize = MAX (1, blocksize); /* for the next timestamp, use the sample counter, which will * never accumulate rounding errors */