mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 09:40:37 +00:00
audioaggregator: Use downstream allocator and params if available
https://bugzilla.gnome.org/show_bug.cgi?id=746529
This commit is contained in:
parent
9897c5c80d
commit
ea26b9aa37
1 changed files with 11 additions and 2 deletions
|
@ -1024,10 +1024,19 @@ static GstBuffer *
|
||||||
gst_audio_aggregator_create_output_buffer (GstAudioAggregator * aagg,
|
gst_audio_aggregator_create_output_buffer (GstAudioAggregator * aagg,
|
||||||
guint num_frames)
|
guint num_frames)
|
||||||
{
|
{
|
||||||
GstBuffer *outbuf = gst_buffer_new_allocate (NULL, num_frames *
|
GstAllocator *allocator;
|
||||||
GST_AUDIO_INFO_BPF (&aagg->info), NULL);
|
GstAllocationParams params;
|
||||||
|
GstBuffer *outbuf;
|
||||||
GstMapInfo outmap;
|
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_buffer_map (outbuf, &outmap, GST_MAP_WRITE);
|
||||||
gst_audio_format_fill_silence (aagg->info.finfo, outmap.data, outmap.size);
|
gst_audio_format_fill_silence (aagg->info.finfo, outmap.data, outmap.size);
|
||||||
gst_buffer_unmap (outbuf, &outmap);
|
gst_buffer_unmap (outbuf, &outmap);
|
||||||
|
|
Loading…
Reference in a new issue