mirror of
https://code.videolan.org/videolan/vlc
synced 2024-10-03 01:31:53 +02:00
vdpau: hold video context when creating a field
This commit is contained in:
parent
724a978ba8
commit
cd341e3c4f
@ -73,6 +73,7 @@ static vlc_vdp_video_field_t *CreateSurface(vlc_va_t *va, vdpau_decoder_device_t
|
|||||||
vlc_vdp_video_field_t *field = vlc_vdp_video_create(sys->vctx, surface);
|
vlc_vdp_video_field_t *field = vlc_vdp_video_create(sys->vctx, surface);
|
||||||
if (unlikely(field == NULL))
|
if (unlikely(field == NULL))
|
||||||
vdp_video_surface_destroy(vdpau_decoder->vdp, surface);
|
vdp_video_surface_destroy(vdpau_decoder->vdp, surface);
|
||||||
|
vlc_video_context_Release(sys->vctx);
|
||||||
return field;
|
return field;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ vlc_vdp_video_field_t *vlc_vdp_video_create(struct vlc_video_context *vctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
field->context = (picture_context_t) {
|
field->context = (picture_context_t) {
|
||||||
VideoSurfaceDestroy, VideoSurfaceCopy, vctx,
|
VideoSurfaceDestroy, VideoSurfaceCopy, vlc_video_context_Hold(vctx),
|
||||||
};
|
};
|
||||||
field->frame = frame;
|
field->frame = frame;
|
||||||
field->structure = VDP_VIDEO_MIXER_PICTURE_STRUCTURE_FRAME;
|
field->structure = VDP_VIDEO_MIXER_PICTURE_STRUCTURE_FRAME;
|
||||||
@ -129,7 +129,6 @@ VdpStatus vlc_vdp_video_attach(struct vlc_video_context *vctx,
|
|||||||
|
|
||||||
field->context.destroy = VideoSurfaceDestroy;
|
field->context.destroy = VideoSurfaceDestroy;
|
||||||
field->context.copy = VideoSurfaceCloneWithContext;
|
field->context.copy = VideoSurfaceCloneWithContext;
|
||||||
field->context.vctx = vlc_video_context_Hold(vctx);
|
|
||||||
|
|
||||||
assert(pic->format.i_chroma == VLC_CODEC_VDPAU_VIDEO_420
|
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_422
|
||||||
|
Loading…
Reference in New Issue
Block a user