mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
eglglessink: Avoid setting height or width twice
This commit is contained in:
parent
eeb3b84d07
commit
2b706d3fbe
1 changed files with 8 additions and 3 deletions
|
@ -2067,16 +2067,21 @@ gst_eglglessink_render_and_display (GstEglGlesSink * eglglessink,
|
||||||
frame.h = h;
|
frame.h = h;
|
||||||
} else {
|
} else {
|
||||||
/* Find suitable matching new size acording to dar & par
|
/* 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?
|
* XXX: Move this to gstutils?
|
||||||
*/
|
*/
|
||||||
frame.w = w;
|
|
||||||
frame.h = h;
|
|
||||||
if (!(h % dar_d))
|
if (!(h % dar_d))
|
||||||
frame.w = gst_util_uint64_scale_int (h, dar_n, dar_d);
|
frame.w = gst_util_uint64_scale_int (h, dar_n, dar_d);
|
||||||
|
frame.h = h;
|
||||||
else if (!(w % dar_n))
|
else if (!(w % dar_n))
|
||||||
frame.h = gst_util_uint64_scale_int (w, dar_d, 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.w = gst_util_uint64_scale_int (h, dar_n, dar_d);
|
||||||
|
frame.h = h;
|
||||||
}
|
}
|
||||||
|
|
||||||
surface.w = eglglessink->eglglesctx->surface_width;
|
surface.w = eglglessink->eglglesctx->surface_width;
|
||||||
|
|
Loading…
Reference in a new issue