[vlc-commits] va_surface: use a define to count the retries to get a free surface

Steve Lhomme git at videolan.org
Wed Oct 16 11:04:55 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Oct 16 10:57:13 2019 +0200| [a8fb25e68b3fd866eaf1839b4f497ba25ff8cc54] | committer: Steve Lhomme

va_surface: use a define to count the retries to get a free surface

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

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

diff --git a/modules/codec/avcodec/va_surface.c b/modules/codec/avcodec/va_surface.c
index c4fa40c32b..a3e3751511 100644
--- a/modules/codec/avcodec/va_surface.c
+++ b/modules/codec/avcodec/va_surface.c
@@ -38,6 +38,8 @@
 
 #include "avcodec.h"
 
+#define MAX_GET_RETRIES  ((VLC_TICK_FROM_SEC(1) + VOUT_OUTMEM_SLEEP) / VOUT_OUTMEM_SLEEP)
+
 struct vlc_va_surface_t {
     atomic_uintptr_t     refcount; // 1 ref for the surface existance, 1 per surface/clone in-flight
     picture_context_t    *pic_va_ctx;
@@ -137,7 +139,7 @@ static vlc_va_surface_t *GetSurface(va_pool_t *va_pool)
 
 vlc_va_surface_t *va_pool_Get(va_pool_t *va_pool)
 {
-    unsigned tries = (VLC_TICK_FROM_SEC(1) + VOUT_OUTMEM_SLEEP) / VOUT_OUTMEM_SLEEP;
+    unsigned tries = MAX_GET_RETRIES;
     vlc_va_surface_t *surface;
 
     if (va_pool->surface_count == 0)



More information about the vlc-commits mailing list