waylandsink/wlwindow: take into account the video aspect ratio when determining the...
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.com>
Fri, 13 Jun 2014 14:29:32 +0000 (16:29 +0200)
committerGeorge Kiagiadakis <george.kiagiadakis@collabora.com>
Tue, 17 Jun 2014 11:51:30 +0000 (13:51 +0200)
ext/wayland/wlwindow.c

index 8ecf9ea..4326139 100644 (file)
@@ -124,8 +124,8 @@ gst_wl_window_new_toplevel (GstWlDisplay * display, GstVideoInfo * video_info)
       wl_compositor_create_surface (display->compositor));
 
   gst_wl_window_set_video_info (window, video_info);
-  gst_wl_window_set_render_rectangle (window, 0, 0, video_info->width,
-      video_info->height);
+  gst_wl_window_set_render_rectangle (window, 0, 0, window->video_width,
+      window->video_height);
 
   window->shell_surface = wl_shell_get_shell_surface (display->shell,
       window->surface);
@@ -211,7 +211,8 @@ gst_wl_window_set_video_info (GstWlWindow * window, GstVideoInfo * info)
 {
   g_return_if_fail (window != NULL);
 
-  window->video_width = info->width;
+  window->video_width =
+      gst_util_uint64_scale_int_round (info->width, info->par_n, info->par_d);
   window->video_height = info->height;
 
   if (window->render_rectangle.w != 0)