diff options
author | wm4 <wm4@nowhere> | 2013-11-07 22:17:35 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-11-07 22:17:35 +0100 |
commit | 1b8cd01b1a2521f5b09bb10b4d611478b5641ed1 (patch) | |
tree | c9cc346dcfc4d46322868bafbf9a98e04c865ebb | |
parent | 1889c62b857fb1634399e40155cf53cfd0430a1e (diff) |
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.
-rw-r--r-- | video/decode/vdpau.c | 16 |
1 files changed, 2 insertions, 14 deletions
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); |