diff options
author | wm4 <wm4@nowhere> | 2013-11-27 20:57:08 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-11-27 21:14:39 +0100 |
commit | aa73ac8db81b8efb04bf2a5c7256e8a847f49fed (patch) | |
tree | c4cf23208ded424cb57314f55e0f0d15f23bdd74 /mpvcore/player/playloop.c | |
parent | 5d97ac229a9a536a2fc5c746fd8a64c805001b6a (diff) | |
download | mpv-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 'mpvcore/player/playloop.c')
-rw-r--r-- | mpvcore/player/playloop.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mpvcore/player/playloop.c b/mpvcore/player/playloop.c index 650f164f05..9ec62834b4 100644 --- a/mpvcore/player/playloop.c +++ b/mpvcore/player/playloop.c @@ -173,6 +173,7 @@ static void seek_reset(struct MPContext *mpctx, bool reset_ao) video_reset_decoding(mpctx->d_video); vo_seek_reset(mpctx->video_out); mpctx->video_pts = MP_NOPTS_VALUE; + mpctx->video_next_pts = MP_NOPTS_VALUE; mpctx->delay = 0; mpctx->time_frame = 0; } @@ -616,7 +617,7 @@ static void adjust_sync(struct MPContext *mpctx, double frame_time) return; double a_pts = written_audio_pts(mpctx) - mpctx->delay; - double v_pts = mpctx->d_video->pts; + double v_pts = mpctx->video_next_pts; double av_delay = a_pts - v_pts; // Try to sync vo_flip() so it will *finish* at given time av_delay += mpctx->last_vo_flip_duration; @@ -1010,7 +1011,7 @@ void run_playloop(struct MPContext *mpctx) } if (endpts != MP_NOPTS_VALUE) - video_left &= mpctx->d_video->pts < endpts; + video_left &= mpctx->video_next_pts < endpts; handle_heartbeat_cmd(mpctx); @@ -1064,7 +1065,7 @@ void run_playloop(struct MPContext *mpctx) //=================== FLIP PAGE (VIDEO BLT): ====================== vo_new_frame_imminent(vo); - mpctx->video_pts = mpctx->d_video->pts; + mpctx->video_pts = mpctx->video_next_pts; mpctx->last_vo_pts = mpctx->video_pts; mpctx->playback_pts = mpctx->video_pts; update_subtitles(mpctx); |