diff options
author | wm4 <wm4@nowhere> | 2013-11-27 20:56:38 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-11-27 21:14:39 +0100 |
commit | 5d97ac229a9a536a2fc5c746fd8a64c805001b6a (patch) | |
tree | 16345e501bdab0cf3c8f8bf5f573ffaef78cc939 /video | |
parent | f5219720f8917145cb2e0d9258b3233de1a6fb19 (diff) | |
download | mpv-5d97ac229a9a536a2fc5c746fd8a64c805001b6a.tar.bz2 mpv-5d97ac229a9a536a2fc5c746fd8a64c805001b6a.tar.xz |
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.
Diffstat (limited to 'video')
-rw-r--r-- | video/decode/dec_video.c | 10 |
1 files changed, 7 insertions, 3 deletions
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; |