diff options
author | Mark Thompson <sw@jkqxz.net> | 2016-11-25 12:36:05 +0000 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2016-11-26 18:03:05 +0000 |
commit | d30719e62de68975cbc7ffd318df03a183037563 (patch) | |
tree | ebb29f4d2e52cd220c7ac768b78c63ecba0ce4c0 /libavutil/hwcontext_vaapi.c | |
parent | 4adbb44ad154cec05e87de60bb827a13c0fe87df (diff) | |
download | ffmpeg-d30719e62de68975cbc7ffd318df03a183037563.tar.gz |
hwcontext_vaapi: Don't abort on failing to allocate from a fixed-size pool
Diffstat (limited to 'libavutil/hwcontext_vaapi.c')
-rw-r--r-- | libavutil/hwcontext_vaapi.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c index 1988729637..b2e212c1fe 100644 --- a/libavutil/hwcontext_vaapi.c +++ b/libavutil/hwcontext_vaapi.c @@ -388,6 +388,10 @@ static AVBufferRef *vaapi_pool_alloc(void *opaque, int size) VAStatus vas; AVBufferRef *ref; + if (hwfc->initial_pool_size > 0 && + avfc->nb_surfaces >= hwfc->initial_pool_size) + return NULL; + vas = vaCreateSurfaces(hwctx->display, ctx->rt_format, hwfc->width, hwfc->height, &surface_id, 1, |