From 017fafac4423fe2d868da7622f5d8d968a1b9fe7 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Fri, 24 Apr 2009 03:39:54 +0300 Subject: core: Handle missing timestamp errors a bit better If there is no timestamp available for a video frame at all, use timestamp from the previous frame (if any) instead of leaving it as MP_NOPTS_VALUE. The main practical difference for playback is that MP_NOPTS_VALUE caused timing to be reset, moving current video position immediately to time of the next frame that had a timestamp and thus likely advancing the video too fast. Now the next frame with a timestamp will be shown at its proper position relative to the previous timestamp. --- mplayer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mplayer.c b/mplayer.c index 1bd4cfaf2b..0f2cae6736 100644 --- a/mplayer.c +++ b/mplayer.c @@ -2315,6 +2315,8 @@ static double update_video(struct MPContext *mpctx, int *blit_frame) mp_msg(MSGT_CPLAYER, MSGL_ERR, "Video pts after filters MISSING\n"); // Try to use decoder pts from before filters pts = sh_video->pts; + if (pts == MP_NOPTS_VALUE) + pts = sh_video->last_pts; } sh_video->pts = pts; if (sh_video->last_pts == MP_NOPTS_VALUE) -- cgit v1.2.3