From 1b8cd01b1a2521f5b09bb10b4d611478b5641ed1 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 7 Nov 2013 22:17:35 +0100 Subject: vdpau: drop dummy render function This was supposed to handle preemption better. I still think the current state isn't very nice, since the decoder can "accidentally" call the previous render function after preemption (instead of calling the reloaded function), so there might be issues. But all in all, this dummy_render function is a bit confusing, and still not entirely correct, so it's not worth it. --- video/decode/vdpau.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'video') diff --git a/video/decode/vdpau.c b/video/decode/vdpau.c index 544ced51c3..74e5ae7063 100644 --- a/video/decode/vdpau.c +++ b/video/decode/vdpau.c @@ -69,24 +69,12 @@ static const struct hwdec_profile_entry profiles[] = { {0} }; -// libavcodec absolutely wants a non-NULL render callback -static VdpStatus dummy_render( - VdpDecoder decoder, - VdpVideoSurface target, - VdpPictureInfo const * picture_info, - uint32_t bitstream_buffer_count, - VdpBitstreamBuffer const * bitstream_buffers) -{ - return VDP_STATUS_DISPLAY_PREEMPTED; -} - static void mark_uninitialized(struct lavc_ctx *ctx) { struct priv *p = ctx->hwdec_priv; p->vdp_device = VDP_INVALID_HANDLE; p->context.decoder = VDP_INVALID_HANDLE; - p->context.render = dummy_render; } static int handle_preemption(struct lavc_ctx *ctx) @@ -148,14 +136,12 @@ static bool create_vdp_decoder(struct lavc_ctx *ctx) p->vid_width, p->vid_height, maxrefs, &p->context.decoder); CHECK_ST_WARNING("Failed creating VDPAU decoder"); - p->context.render = p->vdp->decoder_render; if (vdp_st != VDP_STATUS_OK) goto fail; return true; fail: p->context.decoder = VDP_INVALID_HANDLE; - p->context.render = dummy_render; return false; } @@ -207,6 +193,8 @@ static int init(struct lavc_ctx *ctx) }; ctx->hwdec_priv = p; + p->context.render = p->vdp->decoder_render; + p->preemption_counter = p->mpvdp->preemption_counter; mark_uninitialized(ctx); -- cgit v1.2.3