diff options
author | wm4 <wm4@nowhere> | 2014-09-25 20:25:24 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-09-25 21:32:56 +0200 |
commit | d23ffd243f33ce5d6a5649c7909664b0ae1e858e (patch) | |
tree | d237b384b4967682ead44f08d9fd0b7d78632776 /player/playloop.c | |
parent | 9537e33057d99db65bb12d902d660e3b8c47c5ea (diff) | |
download | mpv-d23ffd243f33ce5d6a5649c7909664b0ae1e858e.tar.bz2 mpv-d23ffd243f33ce5d6a5649c7909664b0ae1e858e.tar.xz |
player: rate-limit OSD text update
There's no need to update OSD messages and the terminal status if nobody
is going to see it. Since the player doesn't block on video display
anymore, this update happens to often and probably burns slightly more
CPU than necessary. (OSD redrawing is handled separately, so it's just
mostly useless text processing and such.)
Change it so that it's updated only on every video frame or all 50ms
(whatever comes first).
For VO OSD, we could in theory try to lock to the OSD redraw heuristic
or the display refresh rate, but that's more complicated and doesn't
work for the terminal status.
Diffstat (limited to 'player/playloop.c')
-rw-r--r-- | player/playloop.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/player/playloop.c b/player/playloop.c index 00067302f2..c9eba1b9c2 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -87,6 +87,7 @@ void pause_player(struct MPContext *mpctx) mpctx->step_frames = 0; mpctx->time_frame -= get_relative_time(mpctx); mpctx->osd_function = 0; + mpctx->osd_force_update = true; mpctx->paused_for_cache = false; if (mpctx->ao && mpctx->d_audio) @@ -112,6 +113,7 @@ void unpause_player(struct MPContext *mpctx) goto end; mpctx->paused = false; mpctx->osd_function = 0; + mpctx->osd_force_update = true; if (mpctx->ao && mpctx->d_audio) ao_resume(mpctx->ao); |