summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-05-17 21:59:52 +0200
committerwm4 <wm4@nowhere>2019-09-19 20:37:04 +0200
commitf99d9c5b0892d3cfb7277dbcc19c93c1578c1111 (patch)
tree214c3265081bd8a1576e4f285eda3c2a5bbd0928
parenteb951835fff36e0a3af63ce08b894b59c03502ef (diff)
downloadmpv-f99d9c5b0892d3cfb7277dbcc19c93c1578c1111.tar.bz2
mpv-f99d9c5b0892d3cfb7277dbcc19c93c1578c1111.tar.xz
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.)
-rw-r--r--player/playloop.c7
1 files changed, 4 insertions, 3 deletions
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);