diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c index 46190fd032..d54ee3df53 100644 --- a/video/out/vo_vdpau.c +++ b/video/out/vo_vdpau.c @@ -160,6 +160,12 @@ static int render_video_to_output_surface(struct vo *vo, VdpStatus vdp_st; struct mp_image *mpi = vc->current_image; + vdp_st = vdp->presentation_queue_block_until_surface_idle(vc->flip_queue, + output_surface, + &dummy); + CHECK_VDP_WARNING(vo, "Error when calling " + "vdp_presentation_queue_block_until_surface_idle"); + if (!mpi) { // At least clear the screen if there is nothing to render int flags = VDP_OUTPUT_SURFACE_RENDER_ROTATE_0; @@ -170,12 +176,6 @@ static int render_video_to_output_surface(struct vo *vo, return -1; } - vdp_st = vdp->presentation_queue_block_until_surface_idle(vc->flip_queue, - output_surface, - &dummy); - CHECK_VDP_WARNING(vo, "Error when calling " - "vdp_presentation_queue_block_until_surface_idle"); - if (vc->rgb_mode) { VdpOutputSurface surface = (uintptr_t)mpi->planes[3]; int flags = VDP_OUTPUT_SURFACE_RENDER_ROTATE_0;