mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
vo_opengl: initialize renderer after setting size
This silences the warning: video/out/gl_video.c:1091:51: runtime error: division by zero when running with clang -fsanitize=undefined. Division by zero is legal according to IEEE, but I guess clang doesn't care about standard. While triggering this warning isn't actually avoided in all cases, it's avoided in the common case and also makes people shut up about it.
This commit is contained in:
@@ -2324,6 +2324,8 @@ void gl_video_config(struct gl_video *p, struct mp_image_params *params)
|
||||
uninit_video(p);
|
||||
init_video(p, params);
|
||||
}
|
||||
|
||||
check_resize(p);
|
||||
}
|
||||
|
||||
void gl_video_set_output_depth(struct gl_video *p, int r, int g, int b)
|
||||
|
||||
@@ -225,12 +225,12 @@ static int reconfig(struct vo *vo, struct mp_image_params *params, int flags)
|
||||
p->glctx->register_resize_callback(vo, video_resize_redraw_callback);
|
||||
}
|
||||
|
||||
resize(p);
|
||||
|
||||
gl_video_config(p->renderer, params);
|
||||
|
||||
p->vo_flipped = !!(flags & VOFLAG_FLIPPING);
|
||||
|
||||
resize(p);
|
||||
|
||||
mpgl_unlock(p->glctx);
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user