From f99d9c5b0892d3cfb7277dbcc19c93c1578c1111 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 17 May 2019 21:59:52 +0200 Subject: playloop: update cache properties in idle state This will properly notify observed properties if the player hasn't started actual playback yet, such as with --demuxer-cache-wait. This also happens to cause the main loop more often, which triggers MPV_EVENT_IDLE, and fixes the OSC display. (See previous commit message.) --- player/playloop.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'player') diff --git a/player/playloop.c b/player/playloop.c index 7fcc325c93..61ade84755 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -616,7 +616,7 @@ static void handle_osd_redraw(struct MPContext *mpctx) vo_redraw(mpctx->video_out); } -static void handle_pause_on_low_cache(struct MPContext *mpctx) +static void handle_update_cache(struct MPContext *mpctx) { bool force_update = false; struct MPOpts *opts = mpctx->opts; @@ -1008,7 +1008,7 @@ static void handle_playback_restart(struct MPContext *mpctx) mpctx->video_status < STATUS_READY) return; - handle_pause_on_low_cache(mpctx); + handle_update_cache(mpctx); if (mpctx->video_status == STATUS_READY) { mpctx->video_status = STATUS_PLAYING; @@ -1138,7 +1138,7 @@ void run_playloop(struct MPContext *mpctx) mp_wakeup_core(mpctx); mp_wait_events(mpctx); - handle_pause_on_low_cache(mpctx); + handle_update_cache(mpctx); mp_process_input(mpctx); @@ -1155,6 +1155,7 @@ void mp_idle(struct MPContext *mpctx) mp_wait_events(mpctx); mp_process_input(mpctx); handle_command_updates(mpctx); + handle_update_cache(mpctx); handle_cursor_autohide(mpctx); handle_vo_events(mpctx); update_osd_msg(mpctx); -- cgit v1.2.3