From 4e8ee522f4df73a74befc093640fdf60a43053ec Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 9 Apr 2015 19:22:54 +0200 Subject: 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.) --- video/out/vo_opengl_cb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'video') diff --git a/video/out/vo_opengl_cb.c b/video/out/vo_opengl_cb.c index f9f781c17a..551a650d15 100644 --- a/video/out/vo_opengl_cb.c +++ b/video/out/vo_opengl_cb.c @@ -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})), -- cgit v1.2.3