vdpau: fix hwdec uninit

This is a bit unintuitiv, but it appears hwdec backends have to unset
hwdec_priv manually in their uninit function. Normally with this idiom
you'd expect the common code to do this (and maybe even freeing the priv
struct). Since other hwdec backends do this quite consistently, just fix
vdpau for now.

Also add an assert to detect similar bugs sooner.

Fixes #3788.
This commit is contained in:
wm4 2016-11-10 08:39:09 +01:00
parent fc1017c335
commit ca175871cd
2 changed files with 2 additions and 1 deletions

View File

@ -598,6 +598,7 @@ static void uninit_avctx(struct dec_video *vd)
if (ctx->hwdec && ctx->hwdec->uninit)
ctx->hwdec->uninit(ctx);
ctx->hwdec = NULL;
assert(ctx->hwdec_priv == NULL);
av_freep(&ctx->avctx);

View File

@ -86,7 +86,7 @@ static void uninit(struct lavc_ctx *ctx)
XCloseDisplay(p->display);
}
talloc_free(p);
TA_FREEP(&ctx->hwdec_priv);
if (ctx->avctx)
av_freep(&ctx->avctx->hwaccel_context);