mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
lavd/opengl_enc: fix window size correction code
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
This commit is contained in:
parent
45601854b1
commit
db4b03146c
@ -872,8 +872,8 @@ static av_cold int opengl_prepare_vertex(AVFormatContext *s)
|
|||||||
int tex_w, tex_h;
|
int tex_w, tex_h;
|
||||||
|
|
||||||
if (opengl->window_width > opengl->max_viewport_width || opengl->window_height > opengl->max_viewport_height) {
|
if (opengl->window_width > opengl->max_viewport_width || opengl->window_height > opengl->max_viewport_height) {
|
||||||
opengl->window_width = FFMAX(opengl->window_width, opengl->max_viewport_width);
|
opengl->window_width = FFMIN(opengl->window_width, opengl->max_viewport_width);
|
||||||
opengl->window_height = FFMAX(opengl->window_height, opengl->max_viewport_height);
|
opengl->window_height = FFMIN(opengl->window_height, opengl->max_viewport_height);
|
||||||
av_log(opengl, AV_LOG_WARNING, "Too big viewport requested, limited to %dx%d", opengl->window_width, opengl->window_height);
|
av_log(opengl, AV_LOG_WARNING, "Too big viewport requested, limited to %dx%d", opengl->window_width, opengl->window_height);
|
||||||
}
|
}
|
||||||
glViewport(0, 0, opengl->window_width, opengl->window_height);
|
glViewport(0, 0, opengl->window_width, opengl->window_height);
|
||||||
|
Loading…
Reference in New Issue
Block a user