summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/mplayer.c b/mplayer.c
index a0a4c19f20..97fa6aae91 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -2401,8 +2401,14 @@ static double update_video(int *blit_frame)
if (sh_video->last_pts == MP_NOPTS_VALUE)
sh_video->last_pts= sh_video->pts;
else if (sh_video->last_pts > sh_video->pts) {
- sh_video->last_pts = sh_video->pts;
- mp_msg(MSGT_CPLAYER, MSGL_INFO, "pts value < previous\n");
+ // make a guess whether this is some kind of discontinuity
+ // we should jump along with or some wron timestamps we
+ // should replace instead
+ if (sh_video->pts < sh_video->last_pts - 20 * sh_video->frametime)
+ sh_video->last_pts = sh_video->pts;
+ else
+ sh_video->pts = sh_video->last_pts + sh_video->frametime;
+ mp_msg(MSGT_CPLAYER, MSGL_V, "pts value < previous\n");
}
frame_time = sh_video->pts - sh_video->last_pts;
sh_video->last_pts = sh_video->pts;