summaryrefslogtreecommitdiffstats
path: root/video/decode
diff options
context:
space:
mode:
authorDan Oscarsson <Dan.Oscarsson@tieto.com>2015-03-31 14:45:35 +0200
committerwm4 <wm4@nowhere>2015-03-31 14:48:34 +0200
commit33d587ffa9cef6d6876e02e4883f1ab27e8636ef (patch)
treed74954ec8bfd0f1dcb9a96e060a3732e15fd4a99 /video/decode
parenta6bf38bcadafd3f7b08b63d8ea1642a9f351f6e6 (diff)
downloadmpv-33d587ffa9cef6d6876e02e4883f1ab27e8636ef.tar.bz2
mpv-33d587ffa9cef6d6876e02e4883f1ab27e8636ef.tar.xz
vdpau: fix preemption handling
Signed-off-by: wm4 <wm4@nowhere>
Diffstat (limited to 'video/decode')
-rw-r--r--video/decode/vdpau.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/video/decode/vdpau.c b/video/decode/vdpau.c
index 43be1f47c1..83dfa0bc56 100644
--- a/video/decode/vdpau.c
+++ b/video/decode/vdpau.c
@@ -29,6 +29,7 @@
#include "video/fmt-conversion.h"
#include "video/vdpau.h"
#include "video/hwdec.h"
+#include "video/decode/dec_video.h"
struct priv {
struct mp_log *log;
@@ -148,6 +149,24 @@ static void uninit(struct lavc_ctx *ctx)
ctx->hwdec_priv = NULL;
}
+#if LIBAVCODEC_VERSION_MICRO >= 100
+static int render2(struct AVCodecContext *avctx, struct AVFrame *frame,
+ const VdpPictureInfo *pic_info, uint32_t buffers_used,
+ const VdpBitstreamBuffer *buffers)
+{
+ struct dec_video *vd = avctx->opaque;
+ struct lavc_ctx *ctx = vd->priv;
+ struct priv *p = ctx->hwdec_priv;
+ VdpVideoSurface surf = (uintptr_t)frame->data[3];
+ VdpStatus status;
+
+ status = p->vdp->decoder_render(p->context->decoder, surf, pic_info,
+ buffers_used, buffers);
+
+ return status;
+}
+#endif
+
static int init(struct lavc_ctx *ctx)
{
struct priv *p = talloc_ptrtype(NULL, p);
@@ -162,7 +181,11 @@ static int init(struct lavc_ctx *ctx)
goto error;
p->vdp = &p->mpvdp->vdp;
+#if LIBAVCODEC_VERSION_MICRO >= 100
+ p->context->render2 = render2;
+#else
p->context->render = p->vdp->decoder_render;
+#endif
p->context->decoder = VDP_INVALID_HANDLE;
if (mp_vdpau_handle_preemption(p->mpvdp, &p->preemption_counter) < 1)