frontends/vdpau: Default destination rect to source rect
authorThong Thai <thong.thai@amd.com>
Mon, 8 Jun 2020 14:29:01 +0000 (10:29 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 9 Jun 2020 18:02:09 +0000 (18:02 +0000)
mpv is passing in a NULL destination_video_rect, which results in a
black screen when playing videos using VDPAU in some cases.

Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5386>

src/gallium/frontends/vdpau/mixer.c

index 2e2bd20ef395d56781049c0154a99df81329b90f..98da01d3e4c48470922143969117c6d51fe1ee38 100644 (file)
@@ -331,6 +331,9 @@ VdpStatus vlVdpVideoMixerRender(VdpVideoMixer mixer,
       }
    }
 
+   if (!destination_video_rect)
+      destination_video_rect = video_source_rect;
+
    prect = RectToPipe(video_source_rect, &rect);
    if (!prect) {
       rect.x0 = 0;