[FFmpeg-devel] [PATCH 1/4] avutils: hwcontext_vaapi, print error if allocated surfaces > pool size
Xu Guangxin
guangxin.xu at intel.com
Thu Nov 18 06:05:46 EET 2021
---
libavutil/hwcontext_vaapi.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c
index 83e542876d..14a2df38c6 100644
--- a/libavutil/hwcontext_vaapi.c
+++ b/libavutil/hwcontext_vaapi.c
@@ -475,8 +475,11 @@ static AVBufferRef *vaapi_pool_alloc(void *opaque, size_t size)
AVBufferRef *ref;
if (hwfc->initial_pool_size > 0 &&
- avfc->nb_surfaces >= hwfc->initial_pool_size)
+ avfc->nb_surfaces >= hwfc->initial_pool_size) {
+ av_log(hwfc, AV_LOG_ERROR, "allocated surfaces count(%d) > pool_size(%d)\n",
+ avfc->nb_surfaces, hwfc->initial_pool_size);
return NULL;
+ }
vas = vaCreateSurfaces(hwctx->display, ctx->rt_format,
hwfc->width, hwfc->height,
--
2.25.1
More information about the ffmpeg-devel
mailing list