summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-11-27 20:57:08 +0100
committerwm4 <wm4@nowhere>2013-11-27 21:14:39 +0100
commitaa73ac8db81b8efb04bf2a5c7256e8a847f49fed (patch)
treec4cf23208ded424cb57314f55e0f0d15f23bdd74 /video
parent5d97ac229a9a536a2fc5c746fd8a64c805001b6a (diff)
downloadmpv-aa73ac8db81b8efb04bf2a5c7256e8a847f49fed.tar.bz2
mpv-aa73ac8db81b8efb04bf2a5c7256e8a847f49fed.tar.xz
video: replace d_video->pts field, change PTS jump checks
The d_video->pts field was a bit strange. The code overwrote it multiple times (on decoding, on filtering, then once again...), and it wasn't really clear what purpose this field had exactly. Replace it with the mpctx->video_next_pts field, which is relatively unambiguous. Move the decreasing PTS check to dec_video.c. This means it acts on decoder output, not on filter output. (Just like in the previous commit, assume the filter chain is sane.) Drop the jitter vs. reset semantics; the dec_video.c determined PTS never goes backwards, and demuxer timestamps don't "jitter".
Diffstat (limited to 'video')
-rw-r--r--video/decode/dec_video.c8
-rw-r--r--video/decode/dec_video.h3
2 files changed, 6 insertions, 5 deletions
diff --git a/video/decode/dec_video.c b/video/decode/dec_video.c
index 402bb805ef..1802e19fbf 100644
--- a/video/decode/dec_video.c
+++ b/video/decode/dec_video.c
@@ -69,7 +69,6 @@ void video_reset_decoding(struct dec_video *d_video)
d_video->codec_dts = MP_NOPTS_VALUE;
d_video->sorted_pts = MP_NOPTS_VALUE;
d_video->unsorted_pts = MP_NOPTS_VALUE;
- d_video->pts = MP_NOPTS_VALUE;
}
int video_vd_control(struct dec_video *d_video, int cmd, void *arg)
@@ -358,9 +357,14 @@ struct mp_image *video_decode(struct dec_video *d_video,
pts += frame_time;
}
+ if (d_video->decoded_pts != MP_NOPTS_VALUE && pts < d_video->decoded_pts) {
+ mp_msg(MSGT_DECVIDEO, MSGL_WARN, "Decreasing video pts: %f < %f\n",
+ pts, d_video->decoded_pts);
+ pts = d_video->decoded_pts;
+ }
+
mpi->pts = pts;
d_video->decoded_pts = pts;
- d_video->pts = pts;
return mpi;
}
diff --git a/video/decode/dec_video.h b/video/decode/dec_video.h
index 9117fceefd..d411717a32 100644
--- a/video/decode/dec_video.h
+++ b/video/decode/dec_video.h
@@ -65,9 +65,6 @@ struct dec_video {
// Final PTS of previously decoded image
double decoded_pts;
- // PTS of the last decoded frame (often overwritten by player)
- double pts;
-
float stream_aspect; // aspect ratio in media headers (DVD IFO files)
int i_bps; // == bitrate (compressed bytes/sec)
float fps; // FPS from demuxer or from user override