Skip to content
Snippets Groups Projects
Commit 7c27f01b authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont Committed by Hugo Beauzée-Luyssen
Browse files

vdpau: hold the video context while cloning a picture context

parent 4fa9fbc3
No related branches found
No related tags found
No related merge requests found
......@@ -112,9 +112,6 @@ static int Lock(vlc_va_t *va, picture_t *pic, AVCodecContext *ctx, AVFrame *fram
if (field == NULL)
return VLC_ENOMEM;
field->context.copy = VideoSurfaceCloneWithContext;
field->context.vctx = vlc_video_context_Hold(sys->vctx);
pic->context = &field->context;
frame->data[3] = (void *)(uintptr_t)field->frame->surface;
return VLC_SUCCESS;
......
......@@ -67,7 +67,7 @@ static picture_context_t *VideoSurfaceCopy(picture_context_t *ctx)
return NULL;
*fnew = *fold;
vlc_video_context_Hold(ctx->vctx);
atomic_fetch_add(&fold->frame->refs, 1);
return &fnew->context;
}
......@@ -127,9 +127,6 @@ VdpStatus vlc_vdp_video_attach(struct vlc_video_context *vctx,
if (unlikely(field == NULL))
return VDP_STATUS_RESOURCES;
field->context.destroy = VideoSurfaceDestroy;
field->context.copy = VideoSurfaceCloneWithContext;
assert(pic->format.i_chroma == VLC_CODEC_VDPAU_VIDEO_420
|| pic->format.i_chroma == VLC_CODEC_VDPAU_VIDEO_422
|| pic->format.i_chroma == VLC_CODEC_VDPAU_VIDEO_444);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment