[vlc-commits] vdpau: don't use the va when we only need the sys

Steve Lhomme git at videolan.org
Mon Jul 22 11:43:23 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Jul 22 11:23:47 2019 +0200| [abfddf0fa1065dc5ab51a21506872503e3f0ea26] | committer: Steve Lhomme

vdpau: don't use the va when we only need the sys

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

 modules/hw/vdpau/avcodec.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/hw/vdpau/avcodec.c b/modules/hw/vdpau/avcodec.c
index c1d5d79cea..6e4d4d54d2 100644
--- a/modules/hw/vdpau/avcodec.c
+++ b/modules/hw/vdpau/avcodec.c
@@ -70,9 +70,8 @@ static vlc_vdp_video_field_t *CreateSurface(vlc_va_t *va)
     return field;
 }
 
-static vlc_vdp_video_field_t *GetSurface(vlc_va_t *va)
+static vlc_vdp_video_field_t *GetSurface(vlc_va_sys_t *sys)
 {
-    vlc_va_sys_t *sys = va->sys;
     vlc_vdp_video_field_t *f;
 
     for (unsigned i = 0; (f = sys->pool[i]) != NULL; i++)
@@ -89,12 +88,12 @@ static vlc_vdp_video_field_t *GetSurface(vlc_va_t *va)
     return NULL;
 }
 
-static vlc_vdp_video_field_t *Get(vlc_va_t *va)
+static vlc_vdp_video_field_t *Get(vlc_va_sys_t *sys)
 {
     vlc_vdp_video_field_t *field;
     unsigned tries = (VLC_TICK_FROM_SEC(1) + VOUT_OUTMEM_SLEEP) / VOUT_OUTMEM_SLEEP;
 
-    while ((field = GetSurface(va)) == NULL)
+    while ((field = GetSurface(sys)) == NULL)
     {
         if (--tries == 0)
             return NULL;
@@ -108,7 +107,8 @@ static vlc_vdp_video_field_t *Get(vlc_va_t *va)
 
 static int Lock(vlc_va_t *va, picture_t *pic, uint8_t **data)
 {
-    vlc_vdp_video_field_t *field = Get(va);
+    vlc_va_sys_t *sys = va->sys;
+    vlc_vdp_video_field_t *field = Get(sys);
     if (field == NULL)
         return VLC_ENOMEM;
 



More information about the vlc-commits mailing list