From 7c097becf16c7a20cd53a3d9577b67d4d5251d01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= Date: Tue, 11 Jan 2022 21:05:29 +0200 Subject: [PATCH] vdpau: frames need not hold the instance Frames (video surfaces) are always held by one of more fields. Fields already hold the video context, which holds the decoder device, which holds the instance. So frames can rely on any one of their referencing fields to hold the video context. --- modules/hw/vdpau/picture.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/hw/vdpau/picture.c b/modules/hw/vdpau/picture.c index 35223a7873..02fbfce47f 100644 --- a/modules/hw/vdpau/picture.c +++ b/modules/hw/vdpau/picture.c @@ -54,7 +54,6 @@ static void VideoSurfaceDestroy(struct picture_context_t *ctx) if (err != VDP_STATUS_OK) fprintf(stderr, "video surface destruction failure: %s\n", vdp_get_error_string(frame->vdp, err)); - vdp_release_x11(frame->vdp); free(frame); } @@ -107,7 +106,8 @@ vlc_vdp_video_field_t *vlc_vdp_video_create(struct vlc_video_context *vctx, atomic_init(&frame->refs, 1); frame->surface = surface; - frame->vdp = vdp_hold_x11(device->vdp, &frame->device); + frame->vdp = device->vdp; + frame->device = device->device; return field; }