mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 11:29:55 +00:00
mpeg2dec: Set allocation parameters to guarantee 16-byte aligned output buffers
Fixes bug #377713.
This commit is contained in:
parent
711d2b18a7
commit
a7aa984d67
1 changed files with 22 additions and 0 deletions
|
@ -246,6 +246,28 @@ gst_mpeg2dec_decide_allocation (GstVideoDecoder * decoder, GstQuery * query)
|
|||
GstBufferPool *pool;
|
||||
guint size, min, max;
|
||||
GstStructure *config;
|
||||
GstAllocator *allocator;
|
||||
GstAllocationParams params;
|
||||
gboolean update_allocator;
|
||||
|
||||
/* Set allocation parameters to guarantee 16-byte aligned output buffers */
|
||||
if (gst_query_get_n_allocation_params (query) > 0) {
|
||||
gst_query_parse_nth_allocation_param (query, 0, &allocator, ¶ms);
|
||||
update_allocator = TRUE;
|
||||
} else {
|
||||
allocator = NULL;
|
||||
gst_allocation_params_init (¶ms);
|
||||
update_allocator = FALSE;
|
||||
}
|
||||
|
||||
params.align = MAX (params.align, 15);
|
||||
|
||||
if (update_allocator)
|
||||
gst_query_set_nth_allocation_param (query, 0, allocator, ¶ms);
|
||||
else
|
||||
gst_query_add_allocation_param (query, allocator, ¶ms);
|
||||
if (allocator)
|
||||
gst_allocator_unref (allocator);
|
||||
|
||||
if (!GST_VIDEO_DECODER_CLASS (parent_class)->decide_allocation (decoder,
|
||||
query))
|
||||
|
|
Loading…
Reference in a new issue