diff options
author | wm4 <wm4@nowhere> | 2015-11-13 22:51:39 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-11-13 22:51:39 +0100 |
commit | 70d46a9fb88fc520029d888c0e01e682fed4eb70 (patch) | |
tree | 92fda727713ebbc5d452f05e32b255d5cca0a9d7 /player/core.h | |
parent | c362c3d7ae85ac65e5e87004d33775f3cb291498 (diff) | |
download | mpv-70d46a9fb88fc520029d888c0e01e682fed4eb70.tar.bz2 mpv-70d46a9fb88fc520029d888c0e01e682fed4eb70.tar.xz |
player: try to compensate actual audio drift
We always let audio slowly desync until a threshold is reached, and then
pushed it back by applying a maximum compensation speed. Refine what
comes afterwards: instead of playing with the nominal video speed, use
the actual required audio speed for keeping sync as measured by the A/V
difference. (The "actual" speed is the ideal speed with A/V differences
added.)
Although this works in theory, it's somewhat questionable how much this
works in practice. The ideal time value is actually not exact, but is
the time at which the frame is scheduled (could be compensated by using
the time_left calculations in handle_display_sync_frame()). It doesn't
account for speed changes or catastrophic discontinuities. It uses only
10 past frames.
Diffstat (limited to 'player/core.h')
-rw-r--r-- | player/core.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/player/core.h b/player/core.h index ed433b098c..c46147679f 100644 --- a/player/core.h +++ b/player/core.h @@ -99,6 +99,7 @@ struct frame_info { double pts; double duration; // PTS difference to next frame double approx_duration; // possibly fixed/smoothed out duration + double av_diff; // A/V diff at time of scheduling int num_vsyncs; // scheduled vsyncs, if using display-sync }; |