mirror of
https://github.com/mpv-player/mpv
synced 2025-03-19 09:57:34 +00:00
vo_opengl_cb: fix video timing somewhat
Increase the default queue size. This helps with "missed" frames due to the asynchronous nature of the API. All the other VOs are synchronous, so if rendering and displaying takes a while, the common code in vo.c will be blocked until it can continue. But with opengl-cb, vo.c might immediately push the next ready frame, which causes the current frame to be dropped _if_ it wasn't rendered yet. One could fix this by making vo.c wait a while (until the API user calls the render function, which pulls the frame). But setting the default queue size to 2 seems much simpler: instead of dropping the frame, it will be pushed to the API user once the next renderer call finishes. (This is still a bit strange, and will hopefully be cleaned up when video scheduling is redone, but for now this appears to deliver relatively good results.)
This commit is contained in:
parent
11556e0530
commit
4e8ee522f4
@ -405,7 +405,7 @@ static int reconfig(struct vo *vo, struct mp_image_params *params, int flags)
|
||||
#define OPT_BASE_STRUCT struct vo_priv
|
||||
static const struct m_option change_opts[] = {
|
||||
OPT_FLAG("debug", use_gl_debug, 0),
|
||||
OPT_INTRANGE("frame-queue-size", frame_queue_size, 0, 1, 100, OPTDEF_INT(1)),
|
||||
OPT_INTRANGE("frame-queue-size", frame_queue_size, 0, 1, 100, OPTDEF_INT(2)),
|
||||
OPT_CHOICE("frame-drop-mode", frame_drop_mode, 0,
|
||||
({"pop", FRAME_DROP_POP},
|
||||
{"clear", FRAME_DROP_CLEAR})),
|
||||
@ -531,7 +531,7 @@ static int preinit(struct vo *vo)
|
||||
#define OPT_BASE_STRUCT struct vo_priv
|
||||
static const struct m_option options[] = {
|
||||
OPT_FLAG("debug", use_gl_debug, 0),
|
||||
OPT_INTRANGE("frame-queue-size", frame_queue_size, 0, 1, 100, OPTDEF_INT(1)),
|
||||
OPT_INTRANGE("frame-queue-size", frame_queue_size, 0, 1, 100, OPTDEF_INT(2)),
|
||||
OPT_CHOICE("frame-drop-mode", frame_drop_mode, 0,
|
||||
({"pop", FRAME_DROP_POP},
|
||||
{"clear", FRAME_DROP_CLEAR})),
|
||||
|
Loading…
Reference in New Issue
Block a user