glwin32: do vertical flip after picture placement

Vertically swapping the position of the video keeps the place "height".
The vertical position use the inverted position of the bottom position
rather than the top position of the video.
This commit is contained in:
Steve Lhomme 2024-04-09 15:12:44 +02:00
parent 3f6a893627
commit 272514cfdd
1 changed files with 2 additions and 7 deletions

View File

@ -245,16 +245,11 @@ static void Prepare(vout_display_t *vd, picture_t *picture,
return;
if (sys->area.place_changed)
{
struct vout_display_placement place_cfg = vd->cfg->display;
vout_display_place_t place;
vout_display_PlacePicture(&place, vd->source, &vd->cfg->display);
/* Reverse vertical alignment as the GL tex are Y inverted */
if (place_cfg.align.vertical == VLC_VIDEO_ALIGN_TOP)
place_cfg.align.vertical = VLC_VIDEO_ALIGN_BOTTOM;
else if (place_cfg.align.vertical == VLC_VIDEO_ALIGN_BOTTOM)
place_cfg.align.vertical = VLC_VIDEO_ALIGN_TOP;
vout_display_PlacePicture(&place, vd->source, &place_cfg);
place.y = vd->cfg->display.height - (place.y + place.height);
vlc_gl_Resize (sys->gl, place.width, place.height);
vout_display_opengl_SetOutputSize(sys->vgl, vd->cfg->display.width, vd->cfg->display.height);