From: Mark Thompson Date: Fri, 25 Nov 2016 12:36:05 +0000 (+0000) Subject: hwcontext_vaapi: Don't abort on failing to allocate from a fixed-size pool X-Git-Tag: android-x86-7.1-r1~252^2~212 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=d30719e62de68975cbc7ffd318df03a183037563;p=android-x86%2Fexternal-ffmpeg.git hwcontext_vaapi: Don't abort on failing to allocate from a fixed-size pool --- 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,