diff options
author | wm4 <wm4@nowhere> | 2015-04-09 19:22:54 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-04-09 19:22:54 +0200 |
commit | 4e8ee522f4df73a74befc093640fdf60a43053ec (patch) | |
tree | 43190d5bc5a894a9160b8b0766d34d7329237b90 | |
parent | 11556e05305c3d4e46e27c1d4a4521e334844755 (diff) | |
download | mpv-4e8ee522f4df73a74befc093640fdf60a43053ec.tar.bz2 mpv-4e8ee522f4df73a74befc093640fdf60a43053ec.tar.xz |
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.)
-rw-r--r-- | video/out/vo_opengl_cb.c | 4 |
1 files changed, 2 insertions, 2 deletions
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})), |