[vlc-commits] vdpau: fix video scaling

Rinat Ibragimov git at videolan.org
Wed Aug 24 13:09:05 CEST 2016


vlc | branch: master | Rinat Ibragimov <ibragimovrinat at mail.ru> | Mon Jun 13 19:53:02 2016 +0300| [7df48e30dc0f176cb86da361faa1da718593bc29] | committer: Rémi Denis-Courmont

vdpau: fix video scaling

There is a possible issue in VdpVideoMixerRender [1] call. While
destination_rect is set to dst_rect, which is fine, destination_video_rect
parameter is set to NULL, which makes video keep the size, while it's
expected to fill the entire output rectangle.

Proposed patch sets destination_video_rect to dst_rect, which makes
video scale when player window is resized.

[1] http://http.download.nvidia.com/XFree86/vdpau/doxygen/html/group___vdp_video_mixer.html#ga62bf3bf8c5f01322a03b07065c5ea3db

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

There has been no clarifications about the intended behaviour of NULL
destination_video_rect in the VDPAU API specification; presumably the
behaviour of the NVIDIA driver is intended. But the VA-GL driver has
had a different behaviour. This patch avoids relying on either by
setting the destination_video_rect explicitly always since it is not
clear what is correct.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7df48e30dc0f176cb86da361faa1da718593bc29
---

 modules/hw/vdpau/chroma.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/hw/vdpau/chroma.c b/modules/hw/vdpau/chroma.c
index a42aed2..d13515f 100644
--- a/modules/hw/vdpau/chroma.c
+++ b/modules/hw/vdpau/chroma.c
@@ -652,7 +652,8 @@ static picture_t *Render(filter_t *filter, picture_t *src, bool import)
     err = vdp_video_mixer_render(sys->vdp, sys->mixer, VDP_INVALID_HANDLE,
                                  NULL, structure,
                                  MAX_PAST, past, surface, MAX_FUTURE, future,
-                                 &src_rect, output, &dst_rect, NULL, 0, NULL);
+                                 &src_rect, output, &dst_rect, &dst_rect, 0,
+                                 NULL);
     if (err != VDP_STATUS_OK)
     {
         msg_Err(filter, "video %s %s failure: %s", "mixer", "rendering",



More information about the vlc-commits mailing list