[vlc-devel] [PATCH 7/8] vdpau: avcodec: remove wait mechanism

Steve Lhomme robux4 at ycbcr.xyz
Tue Jul 28 11:08:40 CEST 2020


Now that each surface in our pool has a corresponding picture in the decoder
owner picture pool, we don't need to wait for an available surface.
If a picture was available from the pool, a surface is available as well.
---
 modules/hw/vdpau/avcodec.c | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)

diff --git a/modules/hw/vdpau/avcodec.c b/modules/hw/vdpau/avcodec.c
index 6e2a36413ce..ed583803e37 100644
--- a/modules/hw/vdpau/avcodec.c
+++ b/modules/hw/vdpau/avcodec.c
@@ -95,25 +95,11 @@ static vlc_vdp_video_field_t *GetSurface(vlc_va_sys_t *sys)
     return NULL;
 }
 
-static vlc_vdp_video_field_t *Get(vlc_va_sys_t *sys)
-{
-    vlc_vdp_video_field_t *field;
-
-    while ((field = GetSurface(sys)) == NULL)
-    {
-        /* Pool empty. Wait for some time as in src/input/decoder.c.
-         * XXX: Both this and the core should use a semaphore or a CV. */
-        vlc_tick_sleep(VOUT_OUTMEM_SLEEP);
-    }
-
-    return field;
-}
-
 static int Lock(vlc_va_t *va, picture_t *pic, uint8_t **data)
 {
     vlc_va_sys_t *sys = va->sys;
-    vlc_vdp_video_field_t *field = Get(sys);
-    if (field == NULL)
+    vlc_vdp_video_field_t *field = GetSurface(sys);
+    if (unlikely(field == NULL))
         return VLC_ENOMEM;
 
     field->context.copy = VideoSurfaceCloneWithContext;
-- 
2.26.2



More information about the vlc-devel mailing list