summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--video/out/opengl/hwdec_vdpau.c1
-rw-r--r--video/out/vo_vdpau.c1
-rw-r--r--video/vdpau_mixer.c8
-rw-r--r--video/vdpau_mixer.h1
4 files changed, 9 insertions, 2 deletions
diff --git a/video/out/opengl/hwdec_vdpau.c b/video/out/opengl/hwdec_vdpau.c
index b1d49622fc..99e5a1414a 100644
--- a/video/out/opengl/hwdec_vdpau.c
+++ b/video/out/opengl/hwdec_vdpau.c
@@ -49,7 +49,6 @@ static void mark_vdpau_objects_uninitialized(struct gl_hwdec *hw)
struct priv *p = hw->priv;
p->vdp_surface = VDP_INVALID_HANDLE;
- p->mixer->video_mixer = VDP_INVALID_HANDLE;
p->mapped = false;
}
diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c
index b85780e5f8..1dc5dc3b36 100644
--- a/video/out/vo_vdpau.c
+++ b/video/out/vo_vdpau.c
@@ -448,7 +448,6 @@ static void mark_vdpau_objects_uninitialized(struct vo *vo)
forget_frames(vo, false);
vc->black_pixel = VDP_INVALID_HANDLE;
- vc->video_mixer->video_mixer = VDP_INVALID_HANDLE;
vc->flip_queue = VDP_INVALID_HANDLE;
vc->flip_target = VDP_INVALID_HANDLE;
for (int i = 0; i < MAX_OUTPUT_SURFACES; i++)
diff --git a/video/vdpau_mixer.c b/video/vdpau_mixer.c
index 7025aef459..d6f93a9d13 100644
--- a/video/vdpau_mixer.c
+++ b/video/vdpau_mixer.c
@@ -71,6 +71,7 @@ struct mp_vdpau_mixer *mp_vdpau_mixer_create(struct mp_vdpau_ctx *vdp_ctx,
.capabilities = MP_CSP_EQ_CAPS_COLORMATRIX,
},
};
+ mp_vdpau_handle_preemption(mixer->ctx, &mixer->preemption_counter);
return mixer;
}
@@ -228,6 +229,13 @@ int mp_vdpau_mixer_render(struct mp_vdpau_mixer *mixer,
if (!video_rect)
video_rect = &fallback_rect;
+ int pe = mp_vdpau_handle_preemption(mixer->ctx, &mixer->preemption_counter);
+ if (pe < 1) {
+ mixer->video_mixer = VDP_INVALID_HANDLE;
+ if (pe < 0)
+ return -1;
+ }
+
if (video->imgfmt == IMGFMT_VDPAU_OUTPUT) {
VdpOutputSurface surface = (uintptr_t)video->planes[3];
int flags = VDP_OUTPUT_SURFACE_RENDER_ROTATE_0;
diff --git a/video/vdpau_mixer.h b/video/vdpau_mixer.h
index 97bef86d3f..716b57e489 100644
--- a/video/vdpau_mixer.h
+++ b/video/vdpau_mixer.h
@@ -30,6 +30,7 @@ struct mp_vdpau_mixer_frame {
struct mp_vdpau_mixer {
struct mp_log *log;
struct mp_vdpau_ctx *ctx;
+ uint64_t preemption_counter;
bool initialized;
struct mp_image_params image_params;