[FFmpeg-cvslog] hwcontext_vaapi: Don't abort on failing to allocate from a fixed-size pool

Mark Thompson git at videolan.org
Fri Apr 7 06:03:41 EEST 2017


ffmpeg | branch: master | Mark Thompson <sw at jkqxz.net> | Fri Nov 25 12:36:05 2016 +0000| [d30719e62de68975cbc7ffd318df03a183037563] | committer: Mark Thompson

hwcontext_vaapi: Don't abort on failing to allocate from a fixed-size pool

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d30719e62de68975cbc7ffd318df03a183037563
---

 libavutil/hwcontext_vaapi.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c
index 1988729..b2e212c 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,



More information about the ffmpeg-cvslog mailing list