mirror of https://github.com/mpv-player/mpv
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:
parent
fc1017c335
commit
ca175871cd
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue