[vlc-devel] [PATCH 09/16] avcodec: vdpau: do not attempt to decode if we don't have enough surfaces

Steve Lhomme robux4 at ycbcr.xyz
Thu Oct 24 16:20:23 CEST 2019


We try to get the minimum amount that is guaranteed to work. We don't want to
fail in the middle of playback because we actually did not have enough surfaces.
---
 modules/hw/vdpau/avcodec.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/modules/hw/vdpau/avcodec.c b/modules/hw/vdpau/avcodec.c
index f7b19dd05ec..8fb0d12f5f3 100644
--- a/modules/hw/vdpau/avcodec.c
+++ b/modules/hw/vdpau/avcodec.c
@@ -220,7 +220,7 @@ static int Open(vlc_va_t *va, AVCodecContext *avctx, const AVPixFmtDescriptor *d
     }
     sys->pool[i] = NULL;
 
-    if (i < codec_refs + 3u)
+    if (i < refs)
     {
         msg_Err(va, "not enough video RAM");
         while (i > 0)
@@ -232,10 +232,6 @@ static int Open(vlc_va_t *va, AVCodecContext *avctx, const AVPixFmtDescriptor *d
     if (sys->vctx == NULL)
         goto error;
 
-    if (i < refs)
-        msg_Warn(va, "video RAM low (allocated %u of %u buffers)",
-                 i, refs);
-
     const char *infos;
     if (vdp_get_information_string(sys->vdp, &infos) == VDP_STATUS_OK)
         msg_Info(va, "Using %s", infos);
-- 
2.17.1



More information about the vlc-devel mailing list