summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-04-24 03:39:54 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-04-24 04:00:42 +0300
commit017fafac4423fe2d868da7622f5d8d968a1b9fe7 (patch)
tree07c6e81386d3f6ca9be06e0e06427a795db32924
parent1b272e3b2d8de97744c5316e5bdbeb6e8b867b1d (diff)
downloadmpv-017fafac4423fe2d868da7622f5d8d968a1b9fe7.tar.bz2
mpv-017fafac4423fe2d868da7622f5d8d968a1b9fe7.tar.xz
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.
-rw-r--r--mplayer.c2
1 files changed, 2 insertions, 0 deletions
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)