From 0f5aed9c62cb29a53dc1039df786207a2bd80d85 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 3 Aug 2014 20:25:03 +0200 Subject: player: some further playloop cleanups Handle --term-playing-msg at a better place. Move MPV_EVENT_TICK hack into a separate function. Also add some words to the client API that you shouldn't use it. (But better leave breaking it for later.) Handle --frames and frame_step differently. Remove the mess from the playloop, and do it after frame display. Give up on the weird semantics for audio-only mode (they didn't make sense anyway), and adjust the manpage accordingly. --- player/video.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'player/video.c') diff --git a/player/video.c b/player/video.c index 7d33538627..c0e1101858 100644 --- a/player/video.c +++ b/player/video.c @@ -896,4 +896,16 @@ void write_video(struct MPContext *mpctx, double endpts) if (!mpctx->sync_audio_to_video) mpctx->video_status = STATUS_EOF; + + if (mpctx->video_status != STATUS_EOF) { + if (mpctx->step_frames > 0) { + mpctx->step_frames--; + if (!mpctx->step_frames && !opts->pause) + pause_player(mpctx); + } + if (mpctx->max_frames == 0) + mpctx->stop_play = PT_NEXT_ENTRY; + if (mpctx->max_frames > 0) + mpctx->max_frames--; + } } -- cgit v1.2.3