[FFmpeg-cvslog] hwcontext_vaapi: Don't abort on failing to allocate from a fixed-size pool
Mark Thompson
git at videolan.org
Thu Mar 2 12:21:08 EET 2017
ffmpeg | branch: master | Mark Thompson <sw at jkqxz.net> | Fri Nov 25 12:36:05 2016 +0000| [2b8151c80690a71db2cf8009855b4ae1a6abdd4c] | committer: wm4
hwcontext_vaapi: Don't abort on failing to allocate from a fixed-size pool
Cherry-picked from Libav d30719e62de68975cbc7ffd318df03a183037563.
Signed-off-by: wm4 <nfxjfg at googlemail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2b8151c80690a71db2cf8009855b4ae1a6abdd4c
---
libavutil/hwcontext_vaapi.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c
index 6176bdc..da15f89 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,
More information about the ffmpeg-cvslog
mailing list