vaapi: allow allocating additional surfaces during decoding

Fixes problems with --vo=opengl:interpolation. The issue here is that
vo_opengl retains more surfaces than what was preallocated for the
decoder. Until now, we just explicitly failed to decode frames for which
no additional surfaces are available. Since modern drivers usually are
fine with not "registering" surfaces before the decoder is created, just
allow allocating additional surfaces if needed.

(We also could probably recreate the HW decoder, since the HW decoder
should be stateless. But let's try to avoid raising the overall
complexity of the code.)
This commit is contained in:
wm4 2015-07-15 12:37:28 +02:00
parent 423a1a0f6c
commit d1c37c0e29
1 changed files with 2 additions and 3 deletions

View File

@ -275,10 +275,9 @@ static struct mp_image *allocate_image(struct lavc_ctx *ctx, int format,
{
struct priv *p = ctx->hwdec_priv;
struct mp_image *img =
mp_image_pool_get_no_alloc(p->pool, IMGFMT_VAAPI, w, h);
struct mp_image *img = mp_image_pool_get(p->pool, IMGFMT_VAAPI, w, h);
if (!img)
MP_ERR(p, "Insufficient number of surfaces.\n");
MP_ERR(p, "Failed to allocate additional VAAPI surface.\n");
return img;
}