From d30719e62de68975cbc7ffd318df03a183037563 Mon Sep 17 00:00:00 2001 From: Mark Thompson Date: Fri, 25 Nov 2016 12:36:05 +0000 Subject: hwcontext_vaapi: Don't abort on failing to allocate from a fixed-size pool --- libavutil/hwcontext_vaapi.c | 4 ++++ 1 file changed, 4 insertions(+) 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, -- cgit v1.2.3