diff options
author | wm4 <wm4@nowhere> | 2014-11-01 17:32:34 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-11-01 17:32:34 +0100 |
commit | 0c3df23335beb46d02d288d04ff080e18052d42f (patch) | |
tree | bed6ec58ee6e7c78bfe1615096753fe0d64c57a3 /player | |
parent | 98b1f861cbd84ad07f3677d112c06a1bb2c92b45 (diff) | |
download | mpv-0c3df23335beb46d02d288d04ff080e18052d42f.tar.bz2 mpv-0c3df23335beb46d02d288d04ff080e18052d42f.tar.xz |
osd: properly wakeup when the OSD function disappears
Fixes #1236.
Diffstat (limited to 'player')
-rw-r--r-- | player/osd.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/player/osd.c b/player/osd.c index d5c0ecc8ff..e59920dd03 100644 --- a/player/osd.c +++ b/player/osd.c @@ -359,6 +359,8 @@ void set_osd_function(struct MPContext *mpctx, int osd_function) mpctx->osd_function = osd_function; mpctx->osd_function_visible = mp_time_sec() + opts->osd_duration / 1000.0; + mpctx->osd_force_update = true; + mpctx->sleeptime = 0; } /** @@ -483,9 +485,14 @@ void update_osd_msg(struct MPContext *mpctx) } } - if (mpctx->osd_function_visible && now >= mpctx->osd_function_visible) { - mpctx->osd_function_visible = 0; - mpctx->osd_function = 0; + if (mpctx->osd_function_visible) { + double sleep = mpctx->osd_function_visible - now; + if (sleep > 0) { + mpctx->sleeptime = MPMIN(mpctx->sleeptime, sleep); + } else { + mpctx->osd_function_visible = 0; + mpctx->osd_function = 0; + } } if (mpctx->osd_msg_next_duration > 0) { |