[vlc-commits] directdraw: inline picture place clipping
Rémi Denis-Courmont
git at videolan.org
Mon Dec 17 22:12:52 CET 2018
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Dec 17 22:59:41 2018 +0200| [8decc1d40f061439e99a4718bc21feac07ace671] | committer: Rémi Denis-Courmont
directdraw: inline picture place clipping
This cannot possibly result in correct picture scale and position, but
then again, this was already the case before this change.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8decc1d40f061439e99a4718bc21feac07ace671
---
modules/video_output/win32/directdraw.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/modules/video_output/win32/directdraw.c b/modules/video_output/win32/directdraw.c
index b87726d0bf..7b1076efd3 100644
--- a/modules/video_output/win32/directdraw.c
+++ b/modules/video_output/win32/directdraw.c
@@ -1361,7 +1361,20 @@ static int DirectXUpdateOverlay(vout_display_t *vd, LPDIRECTDRAWSURFACE2 surface
cfg.display.height = sys->sys.rect_display.bottom;
vout_display_place_t place;
- vout_display_PlacePicture(&place, &vd->source, &cfg, true);
+ vout_display_PlacePicture(&place, &vd->source, &cfg, false);
+
+ if (place.x < 0) {
+ place.width += -place.x;
+ place.x = 0;
+ }
+ if (place.y < 0) {
+ place.height += -place.y;
+ place.y = 0;
+ }
+ if (place.width > cfg.display.width)
+ place.width = cfg.display.width;
+ if (place.height > cfg.display.height)
+ place.height = cfg.display.height;
dst.left = sys->sys.rect_display.left + place.x;
dst.top = sys->sys.rect_display.top + place.y;
More information about the vlc-commits
mailing list