[vlc-commits] avcodec:va_surface: do not reuse the pool if it's not big enough

Steve Lhomme git at videolan.org
Tue Mar 20 10:36:42 CET 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Mar 20 10:20:14 2018 +0100| [d513cb2347937a3a7a9ef86f632446ee56db267d] | committer: Steve Lhomme

avcodec:va_surface: do not reuse the pool if it's not big enough

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

 modules/codec/avcodec/va_surface.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/codec/avcodec/va_surface.c b/modules/codec/avcodec/va_surface.c
index 60a00c7e99..0f540ca02f 100644
--- a/modules/codec/avcodec/va_surface.c
+++ b/modules/codec/avcodec/va_surface.c
@@ -72,8 +72,11 @@ int va_pool_SetupDecoder(vlc_va_t *va, va_pool_t *va_pool, const AVCodecContext
                   surface_width, surface_height,
                   avctx->coded_width, avctx->coded_height);
 
-    if (va_pool->surface_width == surface_width && va_pool->surface_height == surface_height)
+    if ( va_pool->surface_count >= count &&
+         va_pool->surface_width == surface_width &&
+         va_pool->surface_height == surface_height )
     {
+        msg_Dbg(va, "reusing surface pool");
         err = VLC_SUCCESS;
         goto done;
     }



More information about the vlc-commits mailing list