mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
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.)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user