summaryrefslogtreecommitdiffstats
path: root/player/core.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-08-10 18:38:57 +0200
committerwm4 <wm4@nowhere>2015-08-10 18:38:57 +0200
commit3d1cc17ab27b98294f5710e69250e95347d84598 (patch)
tree5c38e248a621027277ca8636f4aa06ed2a74ceb2 /player/core.h
parent8f2d9db79fc2f542b2973f245cc6b93fd35c1d80 (diff)
downloadmpv-3d1cc17ab27b98294f5710e69250e95347d84598.tar.bz2
mpv-3d1cc17ab27b98294f5710e69250e95347d84598.tar.xz
player: redo estimated-vf-fps calculation
Additionally to taking the average, this tries to use the demuxer FPS to eliminate jitter, and applies some other heuristics to check if the result is sane. This code will also be used for the display sync code (it will actually make use of the require_exact parameter). (The value of doing this over keeping the simpler demux_mkv hack is somewhat questionable. But at least it allows us to deal with other container formats that use jittery timestamps, such as mp4 remuxed from mkv.)
Diffstat (limited to 'player/core.h')
-rw-r--r--player/core.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/player/core.h b/player/core.h
index c34d2ddd6d..75dd2edec7 100644
--- a/player/core.h
+++ b/player/core.h
@@ -76,6 +76,9 @@ enum seek_precision {
MPSEEK_VERY_EXACT,
};
+// Comes from the assumption that some formats round timestamps to ms.
+#define FRAME_DURATION_TOLERANCE 0.0011
+
struct track {
enum stream_type type;
@@ -235,6 +238,7 @@ typedef struct MPContext {
enum playback_status video_status, audio_status;
bool restart_complete;
+ bool broken_fps_header;
/* Set if audio should be timed to start with video frame after seeking,
* not set when e.g. playing cover art */
bool sync_audio_to_video;
@@ -488,5 +492,6 @@ void write_video(struct MPContext *mpctx, double endpts);
void mp_force_video_refresh(struct MPContext *mpctx);
void uninit_video_out(struct MPContext *mpctx);
void uninit_video_chain(struct MPContext *mpctx);
+double stabilize_frame_duration(struct MPContext *mpctx, bool require_exact);
#endif /* MPLAYER_MP_CORE_H */