Browse Source

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

Cherry-picked from Libav d30719e62d.

Signed-off-by: wm4 <nfxjfg@googlemail.com>
tags/n3.3
Mark Thompson wm4 9 years ago
parent
commit
2b8151c806
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavutil/hwcontext_vaapi.c

+ 4
- 0
libavutil/hwcontext_vaapi.c View File

@@ -397,6 +397,10 @@ static AVBufferRef *vaapi_pool_alloc(void *opaque, int size)
VAStatus vas; VAStatus vas;
AVBufferRef *ref; AVBufferRef *ref;


if (hwfc->initial_pool_size > 0 &&
avfc->nb_surfaces >= hwfc->initial_pool_size)
return NULL;

vas = vaCreateSurfaces(hwctx->display, ctx->rt_format, vas = vaCreateSurfaces(hwctx->display, ctx->rt_format,
hwfc->width, hwfc->height, hwfc->width, hwfc->height,
&surface_id, 1, &surface_id, 1,


Loading…
Cancel
Save