From 60b900487257a3435df02c2b2ce54551c59e4311 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 14 Apr 2014 22:19:07 +0200 Subject: command: add property to indicate when pausing due to --keep-open This property is set to "yes" if playback was paused due to --keep-open. The change notification might not always be perfect; maybe that should be improved. --- player/playloop.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'player/playloop.c') diff --git a/player/playloop.c b/player/playloop.c index 967963b5dc..20a3104596 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -204,6 +204,7 @@ static void seek_reset(struct MPContext *mpctx, bool reset_ao, bool reset_ac) mpctx->drop_frame_cnt = 0; mpctx->dropped_frames = 0; mpctx->playback_pts = MP_NOPTS_VALUE; + mpctx->eof_reached = false; #if HAVE_ENCODING encode_lavc_discontinuity(mpctx->encode_lavc_ctx); @@ -834,6 +835,7 @@ static void handle_keep_open(struct MPContext *mpctx) if (opts->keep_open && mpctx->stop_play == AT_END_OF_FILE) { mpctx->stop_play = KEEP_PLAYING; mpctx->playback_pts = mpctx->last_vo_pts; + mpctx->eof_reached = true; pause_player(mpctx, PAUSE_BY_KEEP_OPEN); } } @@ -1306,6 +1308,7 @@ void idle_loop(struct MPContext *mpctx) while (mpctx->opts->player_idle_mode && !mpctx->playlist->current && mpctx->stop_play != PT_QUIT) { + mpctx->eof_reached = true; if (need_reinit) { mp_notify(mpctx, MPV_EVENT_IDLE, NULL); handle_force_window(mpctx, true); -- cgit v1.2.3