Commit a910b64b authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

vdpau: add two buffer per decoder thread

Now that we do not allow arbitrary large buffers (to avoid crashing the
GPU), the initial boundary needs to be large enough for smooth decoding.
parent 1d13fb60
......@@ -153,7 +153,7 @@ static int Open(vlc_va_t *va, AVCodecContext *avctx, enum PixelFormat pix_fmt,
return VLC_EGENERIC;
}
unsigned refs = avctx->refs + avctx->thread_count + 5;
unsigned refs = avctx->refs + 2 * avctx->thread_count + 5;
vlc_va_sys_t *sys = malloc(sizeof (*sys)
+ (refs + 1) * sizeof (sys->pool[0]));
if (unlikely(sys == NULL))
......@@ -199,6 +199,10 @@ static int Open(vlc_va_t *va, AVCodecContext *avctx, enum PixelFormat pix_fmt,
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)
infos = "VDPAU";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment