diff options
author | wm4 <wm4@nowhere> | 2016-02-27 20:02:51 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-02-27 20:03:15 +0100 |
commit | 49660bcc3efa6ec6d86db30fa9d0b71b6a06b7d7 (patch) | |
tree | 4c0f3382ca90511c9c903f8e711e259f0e634d8d /player/video.c | |
parent | 183e2cda309fc81158e18b52e64008a45263212e (diff) | |
download | mpv-49660bcc3efa6ec6d86db30fa9d0b71b6a06b7d7.tar.bz2 mpv-49660bcc3efa6ec6d86db30fa9d0b71b6a06b7d7.tar.xz |
player: minor simplification
No need to pass endpts down in such a dumb way.
Also remove an outdated comment somewhere.
Diffstat (limited to 'player/video.c')
-rw-r--r-- | player/video.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/player/video.c b/player/video.c index 62a144afe9..24e01d3c06 100644 --- a/player/video.c +++ b/player/video.c @@ -749,7 +749,7 @@ static bool have_new_frame(struct MPContext *mpctx, bool eof) // Fill mpctx->next_frames[] with a newly filtered or decoded image. // returns VD_* code -static int video_output_image(struct MPContext *mpctx, double endpts) +static int video_output_image(struct MPContext *mpctx) { struct vo_chain *vo_c = mpctx->vo_chain; bool hrseek = mpctx->hrseek_active && mpctx->video_status == STATUS_SYNCING; @@ -772,6 +772,7 @@ static int video_output_image(struct MPContext *mpctx, double endpts) return r; // error struct mp_image *img = vf_read_output_frame(vo_c->vf); if (img) { + double endpts = get_play_end_pts(mpctx); if (endpts != MP_NOPTS_VALUE && img->pts >= endpts) { r = VD_EOF; } else if (mpctx->max_frames == 0) { @@ -1243,7 +1244,7 @@ static void calculate_frame_duration(struct MPContext *mpctx) mpctx->past_frames[0].approx_duration = approx_duration; } -void write_video(struct MPContext *mpctx, double endpts) +void write_video(struct MPContext *mpctx) { struct MPOpts *opts = mpctx->opts; @@ -1259,7 +1260,7 @@ void write_video(struct MPContext *mpctx, double endpts) if (mpctx->paused && mpctx->video_status >= STATUS_READY) return; - int r = video_output_image(mpctx, endpts); + int r = video_output_image(mpctx); MP_TRACE(mpctx, "video_output_image: %d\n", r); if (r < 0) |