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.)
This commit is contained in:
wm4 2019-05-17 21:59:52 +02:00
parent eb951835ff
commit f99d9c5b08
1 changed files with 4 additions and 3 deletions

View File

@ -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);