diff options
author | Mark Thompson <sw@jkqxz.net> | 2016-11-25 12:36:05 +0000 |
---|---|---|
committer | wm4 <nfxjfg@googlemail.com> | 2017-03-02 11:20:47 +0100 |
commit | 2b8151c80690a71db2cf8009855b4ae1a6abdd4c (patch) | |
tree | 500e9a6e407ead32f52593763f09d126e6b2f1da /libavutil/hwcontext_vaapi.c | |
parent | f07492e7fb6601948649ea09a25a493b3da0b75b (diff) | |
download | ffmpeg-2b8151c80690a71db2cf8009855b4ae1a6abdd4c.tar.gz |
hwcontext_vaapi: Don't abort on failing to allocate from a fixed-size pool
Cherry-picked from Libav d30719e62de68975cbc7ffd318df03a183037563.
Signed-off-by: wm4 <nfxjfg@googlemail.com>
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 6176bdc880..da15f89130 100644 --- a/libavutil/hwcontext_vaapi.c +++ b/libavutil/hwcontext_vaapi.c @@ -397,6 +397,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, |