From 192af725e6871d1e8054b37a2b911f69d87c6a20 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 26 Apr 2015 18:56:46 +0200 Subject: vdpau: always render to cropped size at most vo_opengl (or gl_hwdec_vdpau.c to be specific) calls mp_vdpau_mixer_render() with video_rect=NULL, which means to use the full surface. This is incorrect if the surface is actually cropped, as it can happen with h264. In this case, it was rendering the parts outside of the image. Fix it by making this case use the cropped size instead. Alternative fix for PR #1863. (cherry picked from commit a5ed6e49bf87500ed606437901f00ae9b3da138f) --- video/vdpau_mixer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/video/vdpau_mixer.c b/video/vdpau_mixer.c index 3c8f3fb908..1c6211352e 100644 --- a/video/vdpau_mixer.c +++ b/video/vdpau_mixer.c @@ -220,6 +220,10 @@ int mp_vdpau_mixer_render(struct mp_vdpau_mixer *mixer, { struct vdp_functions *vdp = &mixer->ctx->vdp; VdpStatus vdp_st; + VdpRect fallback_rect = {0, 0, video->w, video->h}; + + if (!video_rect) + video_rect = &fallback_rect; if (video->imgfmt == IMGFMT_VDPAU_OUTPUT) { VdpOutputSurface surface = (uintptr_t)video->planes[3]; -- cgit v1.2.3