summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--player/command.c3
-rw-r--r--player/core.h2
-rw-r--r--player/osd.c5
3 files changed, 9 insertions, 1 deletions
diff --git a/player/command.c b/player/command.c
index 52c2a849a1..ac48a1147f 100644
--- a/player/command.c
+++ b/player/command.c
@@ -5397,6 +5397,9 @@ void handle_command_updates(struct MPContext *mpctx)
void mp_notify(struct MPContext *mpctx, int event, void *arg)
{
+ // The OSD can implicitly reference some properties.
+ mpctx->osd_idle_update = true;
+
command_event(mpctx, event, arg);
mp_client_broadcast_event(mpctx, event, arg);
diff --git a/player/core.h b/player/core.h
index 3a5689b9f3..61360b726e 100644
--- a/player/core.h
+++ b/player/core.h
@@ -243,7 +243,7 @@ typedef struct MPContext {
double osd_msg_visible;
double osd_msg_next_duration;
double osd_last_update;
- bool osd_force_update;
+ bool osd_force_update, osd_idle_update;
char *osd_msg_text;
bool osd_show_pos;
struct osd_progbar_state osd_progbar;
diff --git a/player/osd.c b/player/osd.c
index 3a549c070e..de84421d93 100644
--- a/player/osd.c
+++ b/player/osd.c
@@ -492,6 +492,10 @@ void update_osd_msg(struct MPContext *mpctx)
double now = mp_time_sec();
if (!mpctx->osd_force_update) {
+ // Assume nothing is going on at all.
+ if (!mpctx->osd_idle_update)
+ return;
+
double delay = 0.050; // update the OSD at most this often
double diff = now - mpctx->osd_last_update;
if (diff < delay) {
@@ -500,6 +504,7 @@ void update_osd_msg(struct MPContext *mpctx)
}
}
mpctx->osd_force_update = false;
+ mpctx->osd_idle_update = false;
mpctx->osd_last_update = now;
if (mpctx->osd_visible) {