From 55ab23cc30705f18071e9032957594eda35318aa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Olivier=20Cr=C3=AAte?= Date: Sat, 20 May 2017 17:59:19 +0200 Subject: [PATCH] audioaggregator: Use downstream allocator and params if available https://bugzilla.gnome.org/show_bug.cgi?id=746529 --- gst-libs/gst/audio/gstaudioaggregator.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/audio/gstaudioaggregator.c b/gst-libs/gst/audio/gstaudioaggregator.c index f5c6c2b..d683331 100644 --- a/gst-libs/gst/audio/gstaudioaggregator.c +++ b/gst-libs/gst/audio/gstaudioaggregator.c @@ -1024,10 +1024,19 @@ static GstBuffer * gst_audio_aggregator_create_output_buffer (GstAudioAggregator * aagg, guint num_frames) { - GstBuffer *outbuf = gst_buffer_new_allocate (NULL, num_frames * - GST_AUDIO_INFO_BPF (&aagg->info), NULL); + GstAllocator *allocator; + GstAllocationParams params; + GstBuffer *outbuf; GstMapInfo outmap; + gst_aggregator_get_allocator (GST_AGGREGATOR (aagg), &allocator, ¶ms); + + outbuf = gst_buffer_new_allocate (allocator, num_frames * + GST_AUDIO_INFO_BPF (&aagg->info), ¶ms); + + if (allocator) + gst_object_unref (allocator); + gst_buffer_map (outbuf, &outmap, GST_MAP_WRITE); gst_audio_format_fill_silence (aagg->info.finfo, outmap.data, outmap.size); gst_buffer_unmap (outbuf, &outmap); -- 2.7.4