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.
This commit is contained in:
Rémi Denis-Courmont 2022-01-11 21:05:29 +02:00 committed by Hugo Beauzée-Luyssen
parent 29f94a7174
commit 7c097becf1
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}