Cherry-picked from Libav d30719e62de68975cbc7ffd318df03a183037563.
Showing the changes to libavutil (1 of 1 file). Show all
Unified · Split
| @@ -397,6 +397,10 @@ static AVBufferRef *vaapi_pool_alloc(void *opaque, int size) · 396 unmodified lines | |||
| 397 | VAStatus vas; | 397 | VAStatus vas; |
| 398 | AVBufferRef *ref; | 398 | AVBufferRef *ref; |
| 399 | 399 | ||
| 400 | if (hwfc->initial_pool_size > 0 && | ||
| 401 | avfc->nb_surfaces >= hwfc->initial_pool_size) | ||
| 402 | return NULL; | ||
| 403 | |||
| 400 | vas = vaCreateSurfaces(hwctx->display, ctx->rt_format, | 404 | vas = vaCreateSurfaces(hwctx->display, ctx->rt_format, |
| 401 | hwfc->width, hwfc->height, | 405 | hwfc->width, hwfc->height, |
| 402 | &surface_id, 1, | 406 | &surface_id, 1, |