eglglessink: Avoid setting height or width twice

This commit is contained in:
Reynaldo H. Verdejo Pinochet 2012-09-28 11:48:23 -03:00 committed by Sebastian Dröge
parent eeb3b84d07
commit 2b706d3fbe

View file

@ -2067,16 +2067,21 @@ gst_eglglessink_render_and_display (GstEglGlesSink * eglglessink,
frame.h = h;
} else {
/* Find suitable matching new size acording to dar & par
* rationale for prefering leaving the height untouched
* comes from interlacing considerations.
* XXX: Move this to gstutils?
*/
frame.w = w;
frame.h = h;
if (!(h % dar_d))
frame.w = gst_util_uint64_scale_int (h, dar_n, dar_d);
frame.h = h;
else if (!(w % dar_n))
frame.h = gst_util_uint64_scale_int (w, dar_d, dar_n);
else /* need aprox */
frame.w = w;
else /* Neither width nor height can be precisely scaled.
* Preffer to leave height untouched. See comment above.
*/
frame.w = gst_util_uint64_scale_int (h, dar_n, dar_d);
frame.h = h;
}
surface.w = eglglessink->eglglesctx->surface_width;