summaryrefslogtreecommitdiffstats
path: root/common
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 /common
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 'common')
-rw-r--r--common/common.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/common/common.h b/common/common.h
index af01e38e10..124a0e4956 100644
--- a/common/common.h
+++ b/common/common.h
@@ -68,6 +68,24 @@ enum stream_type {
STREAM_TYPE_COUNT,
};
+enum video_sync {
+ VS_DEFAULT = 0,
+ VS_DISP_RESAMPLE,
+ VS_DISP_RESAMPLE_VDROP,
+ VS_DISP_RESAMPLE_NONE,
+ VS_DISP_ADROP,
+ VS_DISP_VDROP,
+ VS_DISP_NONE,
+ VS_NONE,
+};
+
+#define VS_IS_DISP(x) ((x) == VS_DISP_RESAMPLE || \
+ (x) == VS_DISP_RESAMPLE_VDROP || \
+ (x) == VS_DISP_RESAMPLE_NONE || \
+ (x) == VS_DISP_ADROP || \
+ (x) == VS_DISP_VDROP || \
+ (x) == VS_DISP_NONE)
+
extern const char mpv_version[];
extern const char mpv_builddate[];
extern const char mpv_copyright[];