From ff9c597fbf620bd207aaf123640233bb5f4edd7f Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 23 Jun 2015 19:21:20 +0200 Subject: player: increase tick event update frequency 500ms is a bit too high. Change it to 50ms. This improves client API (and Lua) playback state update frequency. Updating absolutely every time the audio PTS changes would be possible, but is not helpful. Audio samplerates are high to trigger a wakeup feedback loop, so the process would waste CPU time on updating the playback position all the time. (If a client application wants to ensure smooth update of the playback position, it should update the position manually using a timer and by reading the property - the application can make a much better decision at how often the playback has to happen.) --- player/playloop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'player/playloop.c') diff --git a/player/playloop.c b/player/playloop.c index f92f70ba04..65bdf54252 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -918,7 +918,7 @@ void handle_force_window(struct MPContext *mpctx, bool reconfig) static void handle_dummy_ticks(struct MPContext *mpctx) { if (mpctx->video_status == STATUS_EOF || mpctx->paused) { - if (mp_time_sec() - mpctx->last_idle_tick > 0.5) { + if (mp_time_sec() - mpctx->last_idle_tick > 0.050) { mpctx->last_idle_tick = mp_time_sec(); mp_notify(mpctx, MPV_EVENT_TICK, NULL); } -- cgit v1.2.3