path: root/player/video.c
diff options
authorwm4 <wm4@nowhere>2014-09-25 20:25:24 +0200
committerwm4 <wm4@nowhere>2014-09-25 21:32:56 +0200
commitd23ffd243f33ce5d6a5649c7909664b0ae1e858e (patch)
treed237b384b4967682ead44f08d9fd0b7d78632776 /player/video.c
parent9537e33057d99db65bb12d902d660e3b8c47c5ea (diff)
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/video.c')
1 files changed, 2 insertions, 1 deletions
diff --git a/player/video.c b/player/video.c
index 028132860f..61c7914920 100644
--- a/player/video.c
+++ b/player/video.c
@@ -776,8 +776,9 @@ void write_video(struct MPContext *mpctx, double endpts)
mpctx->last_vo_pts = mpctx->video_pts;
mpctx->playback_pts = mpctx->video_pts;
- update_subtitles(mpctx);
+ mpctx->osd_force_update = true;
+ update_subtitles(mpctx);
vo_queue_frame(vo, mpctx->next_frame[0], pts, duration);
mpctx->next_frame[0] = NULL;