mirror of https://github.com/mpv-player/mpv
audio: fix pool allocation
It reallocated the pool on every request, making the pool completely useless. Oops.
This commit is contained in:
parent
a18b4b2b19
commit
20d5efb419
|
@ -370,7 +370,8 @@ struct mp_audio *mp_audio_pool_get(struct mp_audio_pool *pool,
|
||||||
if (alloc >= INT_MAX)
|
if (alloc >= INT_MAX)
|
||||||
return NULL;
|
return NULL;
|
||||||
av_buffer_pool_uninit(&pool->avpool);
|
av_buffer_pool_uninit(&pool->avpool);
|
||||||
pool->avpool = av_buffer_pool_init(alloc, NULL);
|
pool->element_size = alloc;
|
||||||
|
pool->avpool = av_buffer_pool_init(pool->element_size, NULL);
|
||||||
if (!pool->avpool)
|
if (!pool->avpool)
|
||||||
return NULL;
|
return NULL;
|
||||||
talloc_set_destructor(pool, mp_audio_pool_destructor);
|
talloc_set_destructor(pool, mp_audio_pool_destructor);
|
||||||
|
|
Loading…
Reference in New Issue