[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:49:19 CET 2018


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Mar 20 10:20:14 2018 +0100| [a131a84efb1c7964724613f6ea1537dadf2410b5] | committer: Hugo Beauzée-Luyssen

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

(cherry picked from commit d513cb2347937a3a7a9ef86f632446ee56db267d)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

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

 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