From 5d97ac229a9a536a2fc5c746fd8a64c805001b6a Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 27 Nov 2013 20:56:38 +0100 Subject: video: if PTS is missing, make something up using the framerate Also get rid of the PTS check _after_ filters. This means if there's a video filter which unsets PTS, no warning will be printed. But we assume that all filters are well-behaved enough by now. --- video/decode/dec_video.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'video') diff --git a/video/decode/dec_video.c b/video/decode/dec_video.c index 7266cdfdb6..402bb805ef 100644 --- a/video/decode/dec_video.c +++ b/video/decode/dec_video.c @@ -342,7 +342,13 @@ struct mp_image *video_decode(struct dec_video *d_video, pts = dts; // Alternative PTS determination methods - if (!opts->correct_pts) { + if (sort_pts) + pts = retrieve_sorted_pts(d_video, pts); + + if (!opts->correct_pts || pts == MP_NOPTS_VALUE) { + if (opts->correct_pts) + mp_msg(MSGT_DECVIDEO, MSGL_WARN, "No video PTS! Making something up.\n"); + double frame_time = 1.0f / (d_video->fps > 0 ? d_video->fps : 25); double base = d_video->last_packet_pdts; pts = d_video->decoded_pts; @@ -350,8 +356,6 @@ struct mp_image *video_decode(struct dec_video *d_video, pts = base == MP_NOPTS_VALUE ? 0 : base; pts += frame_time; - } else if (sort_pts) { - pts = retrieve_sorted_pts(d_video, pts); } mpi->pts = pts; -- cgit v1.2.3