From d8b59aa17fda6aff7bf3031abbd716adc1268422 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 25 Nov 2013 23:12:18 +0100 Subject: player: merge no-correct-pts with correct-pts code Now the --no-correct-pts mode is like the normal mode, just with different timestamp calculations. The semantics should be about the same as before this commit. --- video/decode/dec_video.c | 3 +++ video/decode/dec_video.h | 1 + 2 files changed, 4 insertions(+) (limited to 'video') diff --git a/video/decode/dec_video.c b/video/decode/dec_video.c index be2ac8aabe..d2479a7610 100644 --- a/video/decode/dec_video.c +++ b/video/decode/dec_video.c @@ -213,6 +213,9 @@ struct mp_image *video_decode(struct dec_video *d_video, struct MPOpts *opts = d_video->opts; double pts = packet ? packet->pts : MP_NOPTS_VALUE; + if (pts != MP_NOPTS_VALUE) + d_video->last_packet_pts = pts; + if (opts->correct_pts && pts != MP_NOPTS_VALUE) { int delay = -1; video_vd_control(d_video, VDCTRL_QUERY_UNSEEN_FRAMES, &delay); diff --git a/video/decode/dec_video.h b/video/decode/dec_video.h index 3856d12043..827dcb6237 100644 --- a/video/decode/dec_video.h +++ b/video/decode/dec_video.h @@ -58,6 +58,7 @@ struct dec_video { float fps; // FPS from demuxer or from user override float initial_decoder_aspect; + double last_packet_pts; // State used only by player/video.c double last_pts; }; -- cgit v1.2.3