summaryrefslogtreecommitdiffstats
path: root/options/options.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-03-02 15:37:34 +0100
committerJan Ekström <jeebjp@gmail.com>2018-03-03 02:38:01 +0200
commit775b86212d4fbe1a25ce0f1552478e0fb9a7c25e (patch)
tree1ecfd53ab5896234a4f850f808e96d6068c61dbc /options/options.c
parentc917992359fdcae867b53ceab1427a1a9c6c8e78 (diff)
downloadmpv-775b86212d4fbe1a25ce0f1552478e0fb9a7c25e.tar.bz2
mpv-775b86212d4fbe1a25ce0f1552478e0fb9a7c25e.tar.xz
video: add option to reduce latency by 1 or 2 frames
The playback start logic explicitly waits until the first frame has been displayed. Usually this will introduce a wait of 1 vsync. For normal playback this doesn't matter, but with respect to low latency needs, this only leads to additional data getting queued up in the demuxer or network buffers. Another thing is that the timing logic decodes 1 frame ahead (= 1 frame extra latency) to determine the exact duration of a frame. To be fair, there doesn't really seem to be a hard reason why this is needed. With the current code, enabling the option does lead to A/V desync sometimes (if the demuxer FPS is too inaccurate), and also frame drops at playback start in some situations. But this all seems to be avoidable, if the timing logic were to be rewritten completely, which should probably happen in the future. Thus the new option comes with the warning that it can be removed any time. This is also why the option has "hack" in the name.
Diffstat (limited to 'options/options.c')
-rw-r--r--options/options.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/options/options.c b/options/options.c
index 878f7be12f..ebccc5976f 100644
--- a/options/options.c
+++ b/options/options.c
@@ -608,6 +608,7 @@ const m_option_t mp_opts[] = {
{"vo", 1},
{"decoder", 2},
{"decoder+vo", 3})),
+ OPT_FLAG("video-latency-hacks", video_latency_hacks, 0),
OPT_DOUBLE("display-fps", frame_drop_fps, M_OPT_MIN, .min = 0),