summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-05-17 21:53:55 +0200
committerwm4 <wm4@nowhere>2019-09-19 20:37:04 +0200
commiteb951835fff36e0a3af63ce08b894b59c03502ef (patch)
treec3e0cf8c23978452438b3fdfd12b93834fcea4da
parentf08387c55265a69f2e05c83ca81d71770e642fbc (diff)
downloadmpv-eb951835fff36e0a3af63ce08b894b59c03502ef.tar.bz2
mpv-eb951835fff36e0a3af63ce08b894b59c03502ef.tar.xz
player: send MPV_EVENT_TICK during init for the sake of the osc
The OSC's (osc.lua) event handling is fundamentally broken. It waits for MPV_EVENT_TICK to update the UI, and MPV_EVENT_TICK has become entirely meaningless, except as a hack for the OSC. There are many situations where the OSC doesn't properly update because the TICK event it expects isn't sent. Fix one of them: it doesn't update the cache state if the VO window is forced and --demuxer-cache-wait is used. Make it so that the tick event is sent even if playback initialization is taking time. This is still slightly broken, because it works only if the mainloop is actually run, which depends on random circumstances (such as moving the mouse over the VO window). The next commit will add another such circumstance which will make it appear to work, although it's still conceptually broken. If we "fixed" it and strictly woke up the player if the idle timer ran out, we'd send tick events all the time, even if nothing is going on, which we don't want. Fucking shitshow.
-rw-r--r--player/playloop.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/player/playloop.c b/player/playloop.c
index 22a9331055..7fcc325c93 100644
--- a/player/playloop.c
+++ b/player/playloop.c
@@ -945,7 +945,10 @@ err:
// Potentially needed by some Lua scripts, which assume TICK always comes.
static void handle_dummy_ticks(struct MPContext *mpctx)
{
- if (mpctx->video_status == STATUS_EOF || mpctx->paused) {
+ if ((mpctx->video_status != STATUS_PLAYING &&
+ mpctx->video_status != STATUS_DRAINING) ||
+ mpctx->paused)
+ {
if (mp_time_sec() - mpctx->last_idle_tick > 0.050) {
mpctx->last_idle_tick = mp_time_sec();
mp_notify(mpctx, MPV_EVENT_TICK, NULL);