[vlc-commits] wl/shm: preserve video center during resize

Rémi Denis-Courmont git at videolan.org
Wed Sep 3 23:41:20 CEST 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Sep  4 00:41:00 2014 +0300| [c9fb696cf17a2dda3850e2e40ac4f3f057905ee7] | committer: Rémi Denis-Courmont

wl/shm: preserve video center during resize

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

 modules/video_output/wl/shm.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/video_output/wl/shm.c b/modules/video_output/wl/shm.c
index a081240..c16bfe5 100644
--- a/modules/video_output/wl/shm.c
+++ b/modules/video_output/wl/shm.c
@@ -241,8 +241,8 @@ static int Control(vout_display_t *vd, int query, va_list ap)
             vout_display_place_t place;
             video_format_t src;
 
-            sys->x -= vd->fmt.i_x_offset;
-            sys->y -= vd->fmt.i_y_offset;
+            sys->x += vd->fmt.i_visible_width / 2;
+            sys->y += vd->fmt.i_visible_height / 2;
 
             vout_display_PlacePicture(&place, &vd->source, vd->cfg, false);
             video_format_ApplyRotation(&src, &vd->source);
@@ -258,8 +258,8 @@ static int Control(vout_display_t *vd, int query, va_list ap)
             vd->fmt.i_y_offset = src.i_y_offset * place.height
                                                 / src.i_visible_height;
 
-            sys->x += vd->fmt.i_x_offset;
-            sys->y += vd->fmt.i_y_offset;
+            sys->x -= vd->fmt.i_visible_width / 2;
+            sys->y -= vd->fmt.i_visible_height / 2;
 
             ResetPictures(vd);
             break;



More information about the vlc-commits mailing list