summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-02-11 11:26:23 +0100
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>2015-02-11 23:59:16 +0900
commit20d5efb419408086e104f0e8da21f512c17a26e1 (patch)
tree81d8f25becbfde6de5ea98555889b71470e12ca2
parenta18b4b2b1977c376c46a5088d309815e40845a8f (diff)
downloadmpv-20d5efb419408086e104f0e8da21f512c17a26e1.tar.bz2
mpv-20d5efb419408086e104f0e8da21f512c17a26e1.tar.xz
audio: fix pool allocation
It reallocated the pool on every request, making the pool completely useless. Oops.
-rw-r--r--audio/audio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/audio/audio.c b/audio/audio.c
index 57eb9ca20f..e5df25a6ad 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -370,7 +370,8 @@ struct mp_audio *mp_audio_pool_get(struct mp_audio_pool *pool,
if (alloc >= INT_MAX)
return NULL;
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)
return NULL;
talloc_set_destructor(pool, mp_audio_pool_destructor);