diff options
author | wm4 <wm4@nowhere> | 2014-08-22 15:28:05 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-08-22 15:36:48 +0200 |
commit | 4c25b000b5e521c67608284cf23972e2f651e9d3 (patch) | |
tree | 6c46376827fb68320777f7529855141e8699b1aa /player/video.c | |
parent | 75005ec06d13655340439450cd4663bdf7978411 (diff) | |
download | mpv-4c25b000b5e521c67608284cf23972e2f651e9d3.tar.bz2 mpv-4c25b000b5e521c67608284cf23972e2f651e9d3.tar.xz |
player: fix recent speed change regression
Commit 5afc025c broke this. The reason is that mpctx->delay is updated
when a new video frame is added. This value is also needed to resync
audio, but it will be for the wrong PTS. They must be consistent with
each other, and if they aren't, initial sync will be off by N video
frames, which results at least in worse user experience.
This can be reproduced by for example heavily switching between normal
and 2x speed, or similar.
Fix by readding the video_next_pts field (keeping its use minimal,
instead of reverting the commit that removed it).
Diffstat (limited to 'player/video.c')
-rw-r--r-- | player/video.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/player/video.c b/player/video.c index b7d3f27cbe..6a8fade027 100644 --- a/player/video.c +++ b/player/video.c @@ -215,6 +215,7 @@ void reset_video_state(struct MPContext *mpctx) mpctx->delay = 0; mpctx->time_frame = 0; mpctx->video_pts = MP_NOPTS_VALUE; + mpctx->video_next_pts = MP_NOPTS_VALUE; mpctx->total_avsync_change = 0; mpctx->drop_frame_cnt = 0; mpctx->dropped_frames = 0; @@ -552,6 +553,7 @@ static int video_output_image(struct MPContext *mpctx, double endpts) MP_WARN(mpctx, "Jump in video pts: %f -> %f\n", last_pts, pts); frame_time = 0; } + mpctx->video_next_pts = pts; if (mpctx->d_audio) mpctx->delay -= frame_time; if (mpctx->video_status >= STATUS_READY) { |