summaryrefslogtreecommitdiffstats
path: root/options/options.c
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2022-04-06 16:58:32 -0500
committerDudemanguy <random342@airmail.cc>2022-04-11 18:14:22 +0000
commitfe6d9b6962dededc14d161e522e5f44c1ca2cd60 (patch)
tree916afeb652e5ce1642770813c76fb105b4fbd3b4 /options/options.c
parent2c2a856f2512843d12931a1f6f5b15ea76db8502 (diff)
downloadmpv-fe6d9b6962dededc14d161e522e5f44c1ca2cd60.tar.bz2
mpv-fe6d9b6962dededc14d161e522e5f44c1ca2cd60.tar.xz
player: rearrange video sync opts/enums/defines
The video sync logic for mpv lies completely within its core at essentially the highest layer of abstraction. The problem with this is that it is impossible for VOs to know what video sync mode mpv is currently using since it has no access to the opts. Because different video sync modes completely changes how mpv's render loop operates, it's reasonable that a VO may want to change how it renders based on the current mode (see the next commit for an example). Let's just move the video sync option to mp_vo_opts. MPContext, of course, can still access the value of the option so it only requires minor changes in player/video.c. Additionally, move the VS_IS_DISP define from to player/core.h to common/common.h. All VOs already have access to common/common.h, and there's no need for them to gain access to everything that's in player/core.h.
Diffstat (limited to 'options/options.c')
-rw-r--r--options/options.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/options/options.c b/options/options.c
index a8463e29c0..e996eb8026 100644
--- a/options/options.c
+++ b/options/options.c
@@ -162,6 +162,15 @@ static const m_option_t mp_vo_opt_list[] = {
{"override-display-fps", OPT_DOUBLE(override_display_fps),
M_RANGE(0, DBL_MAX)},
{"video-timing-offset", OPT_DOUBLE(timing_offset), M_RANGE(0.0, 1.0)},
+ {"video-sync", OPT_CHOICE(video_sync,
+ {"audio", VS_DEFAULT},
+ {"display-resample", VS_DISP_RESAMPLE},
+ {"display-resample-vdrop", VS_DISP_RESAMPLE_VDROP},
+ {"display-resample-desync", VS_DISP_RESAMPLE_NONE},
+ {"display-adrop", VS_DISP_ADROP},
+ {"display-vdrop", VS_DISP_VDROP},
+ {"display-desync", VS_DISP_NONE},
+ {"desync", VS_NONE})},
#if HAVE_X11
{"x11-netwm", OPT_CHOICE(x11_netwm, {"auto", 0}, {"no", -1}, {"yes", 1})},
{"x11-bypass-compositor", OPT_CHOICE(x11_bypass_compositor,
@@ -719,15 +728,6 @@ static const m_option_t mp_opts[] = {
// a-v sync stuff:
{"initial-audio-sync", OPT_FLAG(initial_audio_sync)},
- {"video-sync", OPT_CHOICE(video_sync,
- {"audio", VS_DEFAULT},
- {"display-resample", VS_DISP_RESAMPLE},
- {"display-resample-vdrop", VS_DISP_RESAMPLE_VDROP},
- {"display-resample-desync", VS_DISP_RESAMPLE_NONE},
- {"display-adrop", VS_DISP_ADROP},
- {"display-vdrop", VS_DISP_VDROP},
- {"display-desync", VS_DISP_NONE},
- {"desync", VS_NONE})},
{"video-sync-max-video-change", OPT_DOUBLE(sync_max_video_change),
M_RANGE(0, DBL_MAX)},
{"video-sync-max-audio-change", OPT_DOUBLE(sync_max_audio_change),