Commit e5058da0 authored by Laurent Aimar's avatar Laurent Aimar
Browse files

Used vlc_memalign for vaapi/dxva2 copy buffer

parent 54bac7d8
......@@ -297,12 +297,9 @@ static void SplitPlanes(uint8_t *dstu, size_t dstu_pitch,
int CopyInitCache(copy_cache_t *cache, unsigned width)
{
cache->size = __MAX((width + 0x0f) & ~ 0x0f, 4096);
cache->base = malloc(16 + cache->size);
if (cache->base == NULL) {
cache->buffer = NULL;
cache->buffer = vlc_memalign(&cache->base, 16, cache->size);
if (!cache->base)
return VLC_EGENERIC;
}
cache->buffer = &cache->base[16 - ((intptr_t)cache->base & 0x0f)];
return VLC_SUCCESS;
}
void CopyCleanCache(copy_cache_t *cache)
......
......@@ -25,7 +25,7 @@
#define _VLC_AVCODEC_COPY_H 1
typedef struct {
uint8_t *base;
void *base;
uint8_t *buffer;
size_t size;
} copy_cache_t;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment