Skip to content

Commit

Permalink
vdpau: always render to cropped size at most
Browse files Browse the repository at this point in the history
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 a5ed6e4)
  • Loading branch information
wm4 authored and Diogo Franco (Kovensky) committed Apr 27, 2015
1 parent d27bb1c commit 192af72
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions video/vdpau_mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 192af72

Please sign in to comment.