From 2c572e2bb1cfa4e225a6a1599f5ecdbcf4bf2dc6 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 13 Mar 2018 11:23:23 +0100 Subject: video: add an option to tune waiting for video timing Probably mostly useful for the libmpv render API. --- options/m_option.h | 3 +++ options/options.c | 2 ++ options/options.h | 2 ++ 3 files changed, 7 insertions(+) (limited to 'options') diff --git a/options/m_option.h b/options/m_option.h index 078e9248b9..2402405cde 100644 --- a/options/m_option.h +++ b/options/m_option.h @@ -616,6 +616,9 @@ extern const char m_option_path_separator; #define OPT_FLOATRANGE(...) \ OPT_RANGE_(float, __VA_ARGS__, .type = &m_option_type_float) +#define OPT_DOUBLERANGE(...) \ + OPT_RANGE_(double, __VA_ARGS__, .type = &m_option_type_double) + #define OPT_INTPAIR(...) \ OPT_GENERAL_NOTYPE(__VA_ARGS__, .type = &m_option_type_intpair) diff --git a/options/options.c b/options/options.c index ebccc5976f..7c7a30ed27 100644 --- a/options/options.c +++ b/options/options.c @@ -139,6 +139,7 @@ static const m_option_t mp_vo_opt_list[] = { OPT_FLAG("keepaspect-window", keepaspect_window, 0), OPT_FLAG("hidpi-window-scale", hidpi_window_scale, 0), OPT_FLAG("native-fs", native_fs, 0), + OPT_DOUBLERANGE("video-timing-offset", timing_offset, 0, 0.0, 1.0), #if HAVE_X11 OPT_CHOICE("x11-netwm", x11_netwm, 0, ({"auto", 0}, {"no", -1}, {"yes", 1})), @@ -176,6 +177,7 @@ const struct m_sub_options vo_sub_opts = { .x11_bypass_compositor = 2, .mmcss_profile = "Playback", .ontop_level = -1, + .timing_offset = 0.050, }, }; diff --git a/options/options.h b/options/options.h index 1c58ca14b1..303b2e5761 100644 --- a/options/options.h +++ b/options/options.h @@ -50,6 +50,8 @@ typedef struct mp_vo_opts { char *mmcss_profile; + double timing_offset; + // vo_drm struct sws_opts *sws_opts; // vo_drm -- cgit v1.2.3