summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-11-27 20:56:38 +0100
committerwm4 <wm4@nowhere>2013-11-27 21:14:39 +0100
commit5d97ac229a9a536a2fc5c746fd8a64c805001b6a (patch)
tree16345e501bdab0cf3c8f8bf5f573ffaef78cc939
parentf5219720f8917145cb2e0d9258b3233de1a6fb19 (diff)
downloadmpv-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.
-rw-r--r--mpvcore/player/video.c7
-rw-r--r--video/decode/dec_video.c10
2 files changed, 7 insertions, 10 deletions
diff --git a/mpvcore/player/video.c b/mpvcore/player/video.c
index a9dffaf6e9..45cfd6ebf4 100644
--- a/mpvcore/player/video.c
+++ b/mpvcore/player/video.c
@@ -313,13 +313,6 @@ double update_video(struct MPContext *mpctx, double endpts)
return 0;
double pts = video_out->next_pts;
- if (pts == MP_NOPTS_VALUE) {
- MP_ERR(mpctx, "Video pts after filters MISSING\n");
- // Try to use decoder pts from before filters
- pts = d_video->pts;
- if (pts == MP_NOPTS_VALUE)
- pts = d_video->last_pts;
- }
if (endpts == MP_NOPTS_VALUE || pts < endpts)
add_frame_pts(mpctx, pts);
if (mpctx->hrseek_active && pts < mpctx->hrseek_pts - .005) {
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;