mirror of
https://github.com/mpv-player/mpv
synced 2025-04-01 23:00:41 +00:00
player: be slightly less prone to framedrop in display sync mode
1 to 2 frames desync is still tolerable, and will be quickly compensated (if everything works).
This commit is contained in:
parent
b0b67cdf5d
commit
750c29766f
@ -960,10 +960,14 @@ static void handle_display_sync_frame(struct MPContext *mpctx,
|
|||||||
|
|
||||||
// If we are too far ahead/behind, attempt to drop/repeat frames. In
|
// If we are too far ahead/behind, attempt to drop/repeat frames. In
|
||||||
// particular, don't attempt to change speed for them.
|
// particular, don't attempt to change speed for them.
|
||||||
if (drop) {
|
if (drop)
|
||||||
drop_repeat = -av_diff / vsync; // round towards 0
|
drop_repeat = -av_diff / vsync; // round towards 0
|
||||||
av_diff += drop_repeat * vsync;
|
|
||||||
}
|
// Tolerate at least 1 video frame desync.
|
||||||
|
if (abs(drop_repeat) <= 1)
|
||||||
|
drop_repeat = 0;
|
||||||
|
|
||||||
|
av_diff += drop_repeat * vsync;
|
||||||
|
|
||||||
if (resample) {
|
if (resample) {
|
||||||
double audio_factor = 1.0;
|
double audio_factor = 1.0;
|
||||||
|
Loading…
Reference in New Issue
Block a user